Skip to content

Commit 11b05e3

Browse files
authored
Support for distconf explicit configuring of state storage and static groups (#16759)
1 parent bad8514 commit 11b05e3

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed

ydb/core/blobstorage/nodewarden/distconf_invoke_static_group.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ namespace NKikimr::NStorage {
88
if (!RunCommonChecks()) {
99
return;
1010
}
11+
if (cmd.GetFromSelfHeal() && !Self->StorageConfig->GetSelfManagementConfig().GetAutomaticStaticGroupManagement()) {
12+
return FinishWithError(TResult::ERROR, "operation forbidden: automatic static group management disabled");
13+
}
1114

1215
bool found = false;
1316
const TVDiskID vdiskId = VDiskIDFromVDiskID(cmd.GetVDiskId());

ydb/core/blobstorage/nodewarden/node_warden_impl.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,6 +1540,15 @@ bool NKikimr::NStorage::DeriveStorageConfig(const NKikimrConfig::TAppConfig& app
15401540
break;
15411541
}
15421542
}
1543+
1544+
#define UPDATE_EXPLICIT_CONFIG(NAME) \
1545+
if (domains.HasExplicit##NAME##Config()) { \
1546+
config->Mutable##NAME##Config()->CopyFrom(domains.GetExplicit##NAME##Config()); \
1547+
}
1548+
1549+
UPDATE_EXPLICIT_CONFIG(StateStorage)
1550+
UPDATE_EXPLICIT_CONFIG(StateStorageBoard)
1551+
UPDATE_EXPLICIT_CONFIG(SchemeBoard)
15431552
}
15441553
}
15451554

ydb/core/mind/bscontroller/self_heal.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ namespace NKikimr::NBsController {
158158
VDiskIDFromVDiskID(*VDiskToReplace, cmd->MutableVDiskId());
159159
cmd->SetConvertToDonor(DonorMode);
160160
cmd->SetIsSelfHealReasonDecommit(IsSelfHealReasonDecommit);
161+
cmd->SetFromSelfHeal(true);
161162
Send(MakeBlobStorageNodeWardenID(SelfId().NodeId()), ev.release());
162163
return;
163164
}

ydb/core/protos/blobstorage_distributed_config.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ message TEvNodeConfigInvokeOnRoot {
167167
bool IgnoreDegradedGroupsChecks = 5;
168168
bool IgnoreVSlotQuotaCheck = 6;
169169
bool IsSelfHealReasonDecommit = 7;
170+
bool FromSelfHeal = 8;
170171
}
171172

172173
// Regenerate configuration so the slain VDisk is no more reported as DESTROY one in the list.

ydb/core/protos/config.proto

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ message TDomainsConfig {
278278
repeated TNamedCompactionPolicy NamedCompactionPolicy = 5;
279279
optional TSecurityConfig SecurityConfig = 6;
280280
optional bool ForbidImplicitStoragePools = 7 [default = true];
281+
282+
// then these configs are set, they override the default StateStorage config for each kind of entity
283+
optional TStateStorage ExplicitStateStorageConfig = 8;
284+
optional TStateStorage ExplicitStateStorageBoardConfig = 9;
285+
optional TStateStorage ExplicitSchemeBoardConfig = 10;
281286
}
282287

283288
message TBlobStorageConfig {
@@ -343,6 +348,10 @@ message TSelfManagementConfig {
343348
// some extra settings
344349
optional bool AutomaticBoxManagement = 21 [default = true]; // invoke BSC DefineHostConfig/DefineBox automatically
345350
optional bool AutomaticBootstrap = 22; // whether bootstrap should be performed automatically; PROHIBITED for production
351+
optional bool AutomaticStaticGroupManagement = 23; // whether distconf/SelfHeal can change static group on its behalf
352+
optional bool AutomaticStateStorageManagement = 24; // the same for state storage
353+
optional bool AutomaticStateStorageBoardManagement = 25; // the same for state storage board
354+
optional bool AutomaticSchemeBoardManagement = 26; // the same for scheme board
346355
}
347356

348357
message TBlobStorageFormatConfig {

0 commit comments

Comments
 (0)