From 73dfe4acd7d527be1ed5698b2bf2db83bc81bc0a Mon Sep 17 00:00:00 2001 From: JackyWoo Date: Sat, 5 Nov 2022 17:56:55 +0800 Subject: [PATCH] Add to default white list --- docs/en/operations/clickhouse-keeper.md | 4 ++-- src/Coordination/CoordinationSettings.cpp | 2 +- src/Coordination/FourLetterCommand.cpp | 2 +- src/Coordination/KeeperServer.cpp | 7 ++++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/en/operations/clickhouse-keeper.md b/docs/en/operations/clickhouse-keeper.md index 17cf3ade6ab..cf2964b1a7c 100644 --- a/docs/en/operations/clickhouse-keeper.md +++ b/docs/en/operations/clickhouse-keeper.md @@ -126,7 +126,7 @@ clickhouse keeper --config /etc/your_path_to_config/config.xml ClickHouse Keeper also provides 4lw commands which are almost the same with Zookeeper. Each command is composed of four letters such as `mntr`, `stat` etc. There are some more interesting commands: `stat` gives some general information about the server and connected clients, while `srvr` and `cons` give extended details on server and connections respectively. -The 4lw commands has a white list configuration `four_letter_word_white_list` which has default value `conf,cons,crst,envi,ruok,srst,srvr,stat,wchc,wchs,dirs,mntr,isro`. +The 4lw commands has a white list configuration `four_letter_word_white_list` which has default value `conf,cons,crst,envi,ruok,srst,srvr,stat,wchs,dirs,mntr,isro,rcvr,apiv,csnp,lgif`. You can issue the commands to ClickHouse Keeper via telnet or nc, at the client port. @@ -309,7 +309,7 @@ Sessions with Ephemerals (1): /clickhouse/task_queue/ddl ``` -- `csnp`: Schedule a snapshot creation task. Return the last committed log index of the scheduled snapshot if success or `Fail to scheduled snapshot creation task.` if failed. +- `csnp`: Schedule a snapshot creation task. Return the last committed log index of the scheduled snapshot if success or `Failed to schedule snapshot creation task.` if failed. ``` 100 diff --git a/src/Coordination/CoordinationSettings.cpp b/src/Coordination/CoordinationSettings.cpp index 3e03ee0d6f4..08b8668a3ab 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"; +const String KeeperConfigurationAndSettings::DEFAULT_FOUR_LETTER_WORD_CMD = "conf,cons,crst,envi,ruok,srst,srvr,stat,wchs,dirs,mntr,isro,rcvr,apiv,csnp,lgif"; KeeperConfigurationAndSettings::KeeperConfigurationAndSettings() : server_id(NOT_EXIST) diff --git a/src/Coordination/FourLetterCommand.cpp b/src/Coordination/FourLetterCommand.cpp index 402270640d2..82123dc8218 100644 --- a/src/Coordination/FourLetterCommand.cpp +++ b/src/Coordination/FourLetterCommand.cpp @@ -481,7 +481,7 @@ String ApiVersionCommand::run() String CreateSnapshotCommand::run() { auto log_index = keeper_dispatcher.createSnapshot(); - return log_index > 0 ? std::to_string(log_index) : "Fail to scheduled snapshot creation task."; + return log_index > 0 ? std::to_string(log_index) : "Failed to schedule snapshot creation task."; } String LogInfoCommand::run() diff --git a/src/Coordination/KeeperServer.cpp b/src/Coordination/KeeperServer.cpp index 5b2659e9a1b..487d0dc4cc3 100644 --- a/src/Coordination/KeeperServer.cpp +++ b/src/Coordination/KeeperServer.cpp @@ -913,15 +913,16 @@ uint64_t KeeperServer::createSnapshot() if (log_idx != 0) LOG_INFO(log, "Snapshot creation scheduled with last committed log index {}.", log_idx); else - LOG_WARNING(log, "Fail to scheduled snapshot creation task."); + LOG_WARNING(log, "Failed to schedule snapshot creation task."); return log_idx; } KeeperLogInfo KeeperServer::getKeeperLogInfo() { KeeperLogInfo log_info; - log_info.first_log_idx = state_manager->load_log_store()->start_index(); - log_info.first_log_term = state_manager->load_log_store()->term_at(log_info.first_log_idx); + auto log_store = state_manager->load_log_store(); + log_info.first_log_idx = log_store->start_index(); + log_info.first_log_term = log_store->term_at(log_info.first_log_idx); log_info.last_log_idx = raft_instance->get_last_log_idx(); log_info.last_log_term = raft_instance->get_last_log_term(); log_info.last_committed_log_idx = raft_instance->get_committed_log_idx();