diff options
author | hor911 <hor911@yandex-team.ru> | 2022-02-24 18:08:36 +0300 |
---|---|---|
committer | hor911 <hor911@yandex-team.ru> | 2022-02-24 18:08:36 +0300 |
commit | 44da7c77d14c74e1ae629e9ff4189b270414fc20 (patch) | |
tree | 9009d9f505b8916db84c79cf8bd801a7182a6336 | |
parent | 154700b20366969d89b7f6b6ffcedf6be3a1deae (diff) | |
download | ydb-44da7c77d14c74e1ae629e9ff4189b270414fc20.tar.gz |
Pass IC port from cmdline to listener and node manager
ref:b67160be46f832a9f1d5379eaf60c5b1a4409289
-rw-r--r-- | ydb/core/driver_lib/cli_utils/cli_cmds_server.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/ydb/core/driver_lib/cli_utils/cli_cmds_server.cpp b/ydb/core/driver_lib/cli_utils/cli_cmds_server.cpp index c4d144cb5a4..d8d29c7b7cc 100644 --- a/ydb/core/driver_lib/cli_utils/cli_cmds_server.cpp +++ b/ydb/core/driver_lib/cli_utils/cli_cmds_server.cpp @@ -487,8 +487,9 @@ protected: } if (NodeId) RunConfig.NodeId = NodeId; + + bool nodeIdFoundInConfig = false; if (AppConfig.HasNameserviceConfig() && NodeId) { - bool nodeIdMatchesConfig = true; TString localhost("localhost"); TString hostname; try { @@ -500,17 +501,26 @@ protected: Y_VERIFY(node.HasHost()); Y_VERIFY(node.HasNodeId()); if (node.GetNodeId() == NodeId) { + nodeIdFoundInConfig = true; if ((node.GetHost() != hostname && node.GetHost() != localhost) || (InterconnectPort && InterconnectPort != node.GetPort())) { - nodeIdMatchesConfig = false; + Y_FAIL("Cannot find passed NodeId = %" PRIu32 " for hostname %s", NodeId, hostname.data()); break; } } } } catch(TSystemError& e) { } - Y_VERIFY(nodeIdMatchesConfig, "Cannot find passed NodeId = %" PRIu32 " for hostname %s", NodeId, hostname.data()); } + + if (!nodeIdFoundInConfig && NodeKind == NODE_KIND_YQ && InterconnectPort && NodeId) { + auto& nameserviceConfig = *AppConfig.MutableNameserviceConfig(); + auto& node = *nameserviceConfig.AddNode(); + node.SetPort(InterconnectPort); + node.SetHost(HostName()); + node.SetNodeId(NodeId); + } + if (config.ParseResult->Has("suppress-version-check")) { if (AppConfig.HasNameserviceConfig()) { AppConfig.MutableNameserviceConfig()->SetSuppressVersionCheck(true); |