diff --git a/docs/en/operations/utilities/clickhouse-keeper-client.md b/docs/en/operations/utilities/clickhouse-keeper-client.md index d6e11fb9613..d06d88598a7 100644 --- a/docs/en/operations/utilities/clickhouse-keeper-client.md +++ b/docs/en/operations/utilities/clickhouse-keeper-client.md @@ -12,7 +12,6 @@ A client application to interact with clickhouse-keeper by its native protocol. - `-q QUERY`, `--query=QUERY` — Query to execute. If this parameter is not passed, `clickhouse-keeper-client` will start in interactive mode. - `-h HOST`, `--host=HOST` — Server host. Default value: `localhost`. - `-p N`, `--port=N` — Server port. Default value: 9181 -- `-c FILE_PATH`, `--config-file=FILE_PATH` — Set path of config file to get the connection string. Default value: `config.xml`. - `--connection-timeout=TIMEOUT` — Set connection timeout in seconds. Default value: 10s. - `--session-timeout=TIMEOUT` — Set session timeout in seconds. Default value: 10s. - `--operation-timeout=TIMEOUT` — Set operation timeout in seconds. Default value: 10s. diff --git a/src/Coordination/CoordinationSettings.cpp b/src/Coordination/CoordinationSettings.cpp index cdd691f6a79..1f27823182a 100644 --- a/src/Coordination/CoordinationSettings.cpp +++ b/src/Coordination/CoordinationSettings.cpp @@ -36,7 +36,7 @@ void CoordinationSettings::loadFromConfig(const String & config_elem, const Poco } -const String KeeperConfigurationAndSettings::DEFAULT_FOUR_LETTER_WORD_CMD = "conf,cons,crst,envi,ruok,srst,srvr,stat,wchs,dirs,mntr,isro,rcvr,apiv,csnp,lgif,rqld,rclc,clrs,ftfl,ydld"; +const String KeeperConfigurationAndSettings::DEFAULT_FOUR_LETTER_WORD_CMD = "conf,cons,crst,envi,ruok,srst,srvr,stat,wchs,dirs,mntr,isro,rcvr,apiv,csnp,lgif,rqld,rclc,clrs,ftfl"; KeeperConfigurationAndSettings::KeeperConfigurationAndSettings() : server_id(NOT_EXIST) diff --git a/src/Coordination/FourLetterCommand.cpp b/src/Coordination/FourLetterCommand.cpp index be2c5ebd071..1bec17f2050 100644 --- a/src/Coordination/FourLetterCommand.cpp +++ b/src/Coordination/FourLetterCommand.cpp @@ -172,9 +172,6 @@ void FourLetterCommandFactory::registerCommands(KeeperDispatcher & keeper_dispat FourLetterCommandPtr feature_flags_command = std::make_shared(keeper_dispatcher); factory.registerCommand(feature_flags_command); - FourLetterCommandPtr yield_leadership_command = std::make_shared(keeper_dispatcher); - factory.registerCommand(yield_leadership_command); - factory.initializeAllowList(keeper_dispatcher); factory.setInitialize(true); } @@ -582,10 +579,4 @@ String FeatureFlagsCommand::run() return ret.str(); } -String YieldLeadershipCommand::run() -{ - keeper_dispatcher.yieldLeadership(); - return "Sent yield leadership request to leader."; -} - } diff --git a/src/Coordination/FourLetterCommand.h b/src/Coordination/FourLetterCommand.h index bb3c616e080..0520da06b6d 100644 --- a/src/Coordination/FourLetterCommand.h +++ b/src/Coordination/FourLetterCommand.h @@ -415,17 +415,4 @@ struct FeatureFlagsCommand : public IFourLetterCommand ~FeatureFlagsCommand() override = default; }; -/// Yield leadership and become follower. -struct YieldLeadershipCommand : public IFourLetterCommand -{ - explicit YieldLeadershipCommand(KeeperDispatcher & keeper_dispatcher_) - : IFourLetterCommand(keeper_dispatcher_) - { - } - - String name() override { return "ydld"; } - String run() override; - ~YieldLeadershipCommand() override = default; -}; - } diff --git a/src/Coordination/KeeperDispatcher.h b/src/Coordination/KeeperDispatcher.h index 6483de7bd19..39941f55d5e 100644 --- a/src/Coordination/KeeperDispatcher.h +++ b/src/Coordination/KeeperDispatcher.h @@ -237,12 +237,6 @@ public: return server->requestLeader(); } - /// Yield leadership and become follower. - void yieldLeadership() - { - return server->yieldLeadership(); - } - void recalculateStorageStats() { return server->recalculateStorageStats(); diff --git a/src/Coordination/KeeperServer.cpp b/src/Coordination/KeeperServer.cpp index 656d009e0a7..82023db071f 100644 --- a/src/Coordination/KeeperServer.cpp +++ b/src/Coordination/KeeperServer.cpp @@ -1101,12 +1101,6 @@ bool KeeperServer::requestLeader() return isLeader() || raft_instance->request_leadership(); } -void KeeperServer::yieldLeadership() -{ - if (isLeader()) - raft_instance->yield_leadership(); -} - void KeeperServer::recalculateStorageStats() { state_machine->recalculateStorageStats(); diff --git a/src/Coordination/KeeperServer.h b/src/Coordination/KeeperServer.h index fde40d7d60f..e5559216e1b 100644 --- a/src/Coordination/KeeperServer.h +++ b/src/Coordination/KeeperServer.h @@ -144,8 +144,6 @@ public: bool requestLeader(); - void yieldLeadership(); - void recalculateStorageStats(); }; diff --git a/tests/integration/helpers/keeper_utils.py b/tests/integration/helpers/keeper_utils.py index 83d0f2969b7..79d498b909f 100644 --- a/tests/integration/helpers/keeper_utils.py +++ b/tests/integration/helpers/keeper_utils.py @@ -248,11 +248,6 @@ def is_leader(cluster, node, port=9181): return "Mode: leader" in stat -def is_follower(cluster, node, port=9181): - stat = send_4lw_cmd(cluster, node, "stat", port) - return "Mode: follower" in stat - - def get_leader(cluster, nodes): for node in nodes: if is_leader(cluster, node): diff --git a/tests/integration/test_keeper_four_word_command/test.py b/tests/integration/test_keeper_four_word_command/test.py index c8f9cb9cd67..48e8f80e4bc 100644 --- a/tests/integration/test_keeper_four_word_command/test.py +++ b/tests/integration/test_keeper_four_word_command/test.py @@ -725,26 +725,3 @@ def test_cmd_clrs(started_cluster): finally: destroy_zk_client(zk) - - -def test_cmd_ydld(started_cluster): - wait_nodes() - for node in [node1, node3]: - data = keeper_utils.send_4lw_cmd(cluster, node, cmd="ydld") - assert data == "Sent yield leadership request to leader." - - print("ydld output -------------------------------------") - print(data) - - if keeper_utils.is_leader(cluster, node): - # wait for it to yield leadership - retry = 0 - while keeper_utils.is_leader(cluster, node) and retry < 30: - time.sleep(1) - retry += 1 - if retry == 30: - print( - node.name - + " did not yield leadership after 30s, maybe there is something wrong." - ) - assert keeper_utils.is_follower(cluster, node)