Skip to content

Commit b2d8cc5

Browse files
authored
Correct SchemeRoot determination based on bootstrap config (#18054)
1 parent dc5fb6e commit b2d8cc5

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

ydb/library/yaml_config/yaml_config_parser.cpp

+15-2
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,20 @@ namespace NKikimr::NYaml {
12851285
}
12861286

12871287
if (!domain.HasSchemeRoot()) {
1288-
domain.SetSchemeRoot(72057594046678944);
1288+
std::optional<ui64> schemeRoot;
1289+
if (config.HasBootstrapConfig()) {
1290+
for (const auto& tablet : config.GetBootstrapConfig().GetTablet()) {
1291+
if (tablet.GetType() != NKikimrConfig::TBootstrap::FLAT_SCHEMESHARD) {
1292+
continue;
1293+
}
1294+
Y_ABORT_UNLESS(tablet.HasInfo());
1295+
Y_ABORT_UNLESS(tablet.GetInfo().HasTabletID());
1296+
const ui64 id = tablet.GetInfo().GetTabletID();
1297+
Y_ABORT_UNLESS(!schemeRoot || *schemeRoot == id);
1298+
schemeRoot.emplace(id);
1299+
}
1300+
}
1301+
domain.SetSchemeRoot(schemeRoot.value_or(72057594046678944));
12891302
}
12901303

12911304
if (!domain.HasPlanResolution()) {
@@ -1426,8 +1439,8 @@ namespace NKikimr::NYaml {
14261439
PrepareStaticGroup(ctx, config, ephemeralConfig);
14271440
PrepareBlobStorageConfig(config, ephemeralConfig);
14281441
PrepareSystemTabletsInfo(config, ephemeralConfig, relaxed);
1429-
PrepareDomainsConfig(config, ephemeralConfig, relaxed);
14301442
PrepareBootstrapConfig(config, ephemeralConfig, relaxed);
1443+
PrepareDomainsConfig(config, ephemeralConfig, relaxed);
14311444
PrepareIcConfig(config, ephemeralConfig);
14321445
PrepareGrpcConfig(config, ephemeralConfig);
14331446
PrepareSecurityConfig(ctx, config, relaxed);

0 commit comments

Comments
 (0)