Skip to content

Commit

Permalink
issue-757: don't load configs from CMS in emergency mode (#2042)
Browse files Browse the repository at this point in the history
  • Loading branch information
SvartMetal authored and Mikhail Montsev committed Sep 17, 2024
1 parent a31d56a commit 33ae451
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
11 changes: 10 additions & 1 deletion cloud/blockstore/libs/daemon/ydb/bootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,23 @@ void TBootstrapYdb::InitKikimrService()
.NodeType = Configs->StorageConfig->GetNodeType(),
};

bool loadCmsConfigs = Configs->Options->LoadCmsConfigs;
if (loadCmsConfigs &&
(Configs->StorageConfig->GetHiveProxyFallbackMode() ||
Configs->StorageConfig->GetSSProxyFallbackMode()))
{
STORAGE_INFO("Disable loading configs from CMS in emergency mode");
loadCmsConfigs = false;
}

NCloud::NStorage::TRegisterDynamicNodeOptions registerOpts {
.Domain = Configs->Options->Domain,
.SchemeShardDir = Configs->StorageConfig->GetSchemeShardDir(),
.NodeBrokerAddress = Configs->Options->NodeBrokerAddress,
.NodeBrokerPort = Configs->Options->NodeBrokerPort,
.UseNodeBrokerSsl = Configs->Options->UseNodeBrokerSsl,
.InterconnectPort = Configs->Options->InterconnectPort,
.LoadCmsConfigs = Configs->Options->LoadCmsConfigs,
.LoadCmsConfigs = loadCmsConfigs,
.Settings = std::move(settings)
};

Expand Down
1 change: 1 addition & 0 deletions cloud/blockstore/tests/loadtest/local-emergency/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def __run_test(test_case):
dict(name="dynamic_storage_pool:2", kind="ssd", pdisk_user_kind=1)
],
bs_cache_file_path=backups_folder + "/bs_cache.txt",
load_configs_from_cms=False,
)

client = CreateClient(env.endpoint)
Expand Down
6 changes: 5 additions & 1 deletion cloud/blockstore/tests/python/lib/loadtest_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def __init__(
kikimr_binary_path=None,
with_endpoint_proxy=False,
with_netlink=False,
load_configs_from_cms=True,
):

self.__endpoint = endpoint
Expand All @@ -76,6 +77,9 @@ def __init__(
if run_kikimr:
self.kikimr_cluster.start()
kikimr_port = list(self.kikimr_cluster.nodes.values())[0].port
else:
# makes sense only when Kikimr is running
load_configs_from_cms = False

self.__devices = []

Expand Down Expand Up @@ -107,7 +111,7 @@ def __init__(
discovery_config=discovery_config,
restart_interval=restart_interval,
dynamic_storage_pools=dynamic_storage_pools,
load_configs_from_cms=run_kikimr,
load_configs_from_cms=load_configs_from_cms,
features_config_patch=features_config_patch,
grpc_trace=grpc_trace,
rack=rack)
Expand Down

0 comments on commit 33ae451

Please sign in to comment.