From d1caa13044a50d5444dd8f4c887ff4e379460899 Mon Sep 17 00:00:00 2001 From: Wu Tao Date: Fri, 2 Apr 2021 05:58:56 -0500 Subject: [PATCH] fix: incorrect help info of meta/replica remote commands (#808) --- src/meta/greedy_load_balancer.cpp | 10 ++++---- src/meta/meta_service.cpp | 2 +- src/meta/server_load_balancer.cpp | 4 ++-- src/meta/server_state.cpp | 8 +++---- src/replica/replica_stub.cpp | 39 ++++++++++++++++--------------- 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/meta/greedy_load_balancer.cpp b/src/meta/greedy_load_balancer.cpp index b68ddaefc8..6feaf4ef2a 100644 --- a/src/meta/greedy_load_balancer.cpp +++ b/src/meta/greedy_load_balancer.cpp @@ -93,7 +93,7 @@ void greedy_load_balancer::register_ctrl_commands() _ctrl_balancer_in_turn = dsn::command_manager::instance().register_command( {"meta.lb.balancer_in_turn"}, - "lb.balancer_in_turn ", + "meta.lb.balancer_in_turn ", "control whether do app balancer in turn", [this](const std::vector &args) { return remote_command_set_bool_flag(_balancer_in_turn, "lb.balancer_in_turn", args); @@ -101,7 +101,7 @@ void greedy_load_balancer::register_ctrl_commands() _ctrl_only_primary_balancer = dsn::command_manager::instance().register_command( {"meta.lb.only_primary_balancer"}, - "lb.only_primary_balancer ", + "meta.lb.only_primary_balancer ", "control whether do only primary balancer", [this](const std::vector &args) { return remote_command_set_bool_flag( @@ -110,7 +110,7 @@ void greedy_load_balancer::register_ctrl_commands() _ctrl_only_move_primary = dsn::command_manager::instance().register_command( {"meta.lb.only_move_primary"}, - "lb.only_move_primary ", + "meta.lb.only_move_primary ", "control whether only move primary in balancer", [this](const std::vector &args) { return remote_command_set_bool_flag(_only_move_primary, "lb.only_move_primary", args); @@ -118,13 +118,13 @@ void greedy_load_balancer::register_ctrl_commands() _get_balance_operation_count = dsn::command_manager::instance().register_command( {"meta.lb.get_balance_operation_count"}, - "lb.get_balance_operation_count [total | move_pri | copy_pri | copy_sec | detail]", + "meta.lb.get_balance_operation_count [total | move_pri | copy_pri | copy_sec | detail]", "get balance operation count", [this](const std::vector &args) { return get_balance_operation_count(args); }); _ctrl_balancer_ignored_apps = dsn::command_manager::instance().register_command( {"meta.lb.ignored_app_list"}, - "lb.ignored_app_list [app_id1,app_id2..]", + "meta.lb.ignored_app_list [app_id1,app_id2..]", "get, set and clear balancer ignored_app_list", [this](const std::vector &args) { return remote_command_balancer_ignored_app_ids(args); diff --git a/src/meta/meta_service.cpp b/src/meta/meta_service.cpp index fe065eb37a..7c8649fd28 100644 --- a/src/meta/meta_service.cpp +++ b/src/meta/meta_service.cpp @@ -255,7 +255,7 @@ void meta_service::register_ctrl_commands() _ctrl_node_live_percentage_threshold_for_update = dsn::command_manager::instance().register_command( {"meta.live_percentage"}, - "live_percentage [num | DEFAULT]", + "meta.live_percentage [num | DEFAULT]", "node live percentage threshold for update", [this](const std::vector &args) { std::string result("OK"); diff --git a/src/meta/server_load_balancer.cpp b/src/meta/server_load_balancer.cpp index 3e235e2fd0..64ef8b3150 100644 --- a/src/meta/server_load_balancer.cpp +++ b/src/meta/server_load_balancer.cpp @@ -856,13 +856,13 @@ void simple_load_balancer::register_ctrl_commands() _ctrl_assign_delay_ms = dsn::command_manager::instance().register_command( {"meta.lb.assign_delay_ms"}, - "lb.assign_delay_ms [num | DEFAULT]", + "meta.lb.assign_delay_ms [num | DEFAULT]", "control the replica_assign_delay_ms_for_dropouts config", [this](const std::vector &args) { return ctrl_assign_delay_ms(args); }); _ctrl_assign_secondary_black_list = dsn::command_manager::instance().register_command( {"meta.lb.assign_secondary_black_list"}, - "lb.assign_secondary_black_list [|clear]", + "meta.lb.assign_secondary_black_list [|clear]", "control the assign secondary black list", [this](const std::vector &args) { return ctrl_assign_secondary_black_list(args); diff --git a/src/meta/server_state.cpp b/src/meta/server_state.cpp index 953b71b958..ea19cf62bb 100644 --- a/src/meta/server_state.cpp +++ b/src/meta/server_state.cpp @@ -81,8 +81,8 @@ void server_state::register_cli_commands() { _cli_dump_handle = dsn::command_manager::instance().register_command( {"meta.dump"}, - "dump: dump app_states of meta server to local file", - "dump -t|--target target_file", + "meta.dump - dump app_states of meta server to local file", + "meta.dump -t|--target target_file", [this](const std::vector &args) { dsn::error_code err; if (args.size() != 2) { @@ -106,7 +106,7 @@ void server_state::register_cli_commands() _ctrl_add_secondary_enable_flow_control = dsn::command_manager::instance().register_command( {"meta.lb.add_secondary_enable_flow_control"}, - "lb.add_secondary_enable_flow_control ", + "meta.lb.add_secondary_enable_flow_control ", "control whether enable add secondary flow control", [this](const std::vector &args) { return remote_command_set_bool_flag( @@ -116,7 +116,7 @@ void server_state::register_cli_commands() _ctrl_add_secondary_max_count_for_one_node = dsn::command_manager::instance().register_command( {"meta.lb.add_secondary_max_count_for_one_node"}, - "lb.add_secondary_max_count_for_one_node [num | DEFAULT]", + "meta.lb.add_secondary_max_count_for_one_node [num | DEFAULT]", "control the max count to add secondary for one node", [this](const std::vector &args) { std::string result("OK"); diff --git a/src/replica/replica_stub.cpp b/src/replica/replica_stub.cpp index 3f40ab1451..b847d16e81 100644 --- a/src/replica/replica_stub.cpp +++ b/src/replica/replica_stub.cpp @@ -2189,8 +2189,8 @@ void replica_stub::register_ctrl_command() std::call_once(flag, [&]() { _kill_partition_command = ::dsn::command_manager::instance().register_command( {"replica.kill_partition"}, - "kill_partition [app_id [partition_index]]", - "kill_partition: kill partitions by (all, one app, one partition)", + "replica.kill_partition [app_id [partition_index]]", + "replica.kill_partition: kill partitions by (all, one app, one partition)", [this](const std::vector &args) { dsn::gpid pid; if (args.size() == 0) { @@ -2211,17 +2211,17 @@ void replica_stub::register_ctrl_command() _deny_client_command = ::dsn::command_manager::instance().register_command( {"replica.deny-client"}, - "deny-client ", - "deny-client - control if deny client read & write request", + "replica.deny-client ", + "replica.deny-client - control if deny client read & write request", [this](const std::vector &args) { return remote_command_set_bool_flag(_deny_client, "deny-client", args); }); _verbose_client_log_command = ::dsn::command_manager::instance().register_command( {"replica.verbose-client-log"}, - "verbose-client-log ", - "verbose-client-log - control if print verbose error log when reply read & write " - "request", + "replica.verbose-client-log ", + "replica.verbose-client-log - control if print verbose error log when reply read & " + "write request", [this](const std::vector &args) { return remote_command_set_bool_flag( _verbose_client_log, "verbose-client-log", args); @@ -2229,8 +2229,8 @@ void replica_stub::register_ctrl_command() _verbose_commit_log_command = ::dsn::command_manager::instance().register_command( {"replica.verbose-commit-log"}, - "verbose-commit-log ", - "verbose-commit-log - control if print verbose log when commit mutation", + "replica.verbose-commit-log ", + "replica.verbose-commit-log - control if print verbose log when commit mutation", [this](const std::vector &args) { return remote_command_set_bool_flag( _verbose_commit_log, "verbose-commit-log", args); @@ -2238,8 +2238,9 @@ void replica_stub::register_ctrl_command() _trigger_chkpt_command = ::dsn::command_manager::instance().register_command( {"replica.trigger-checkpoint"}, - "trigger-checkpoint [id1,id2,...] (where id is 'app_id' or 'app_id.partition_id')", - "trigger-checkpoint - trigger replicas to do checkpoint", + "replica.trigger-checkpoint [id1,id2,...] (where id is 'app_id' or " + "'app_id.partition_id')", + "replica.trigger-checkpoint - trigger replicas to do checkpoint", [this](const std::vector &args) { return exec_command_on_replica(args, true, [this](const replica_ptr &rep) { tasking::enqueue(LPC_PER_REPLICA_CHECKPOINT_TIMER, @@ -2252,8 +2253,8 @@ void replica_stub::register_ctrl_command() _query_compact_command = ::dsn::command_manager::instance().register_command( {"replica.query-compact"}, - "query-compact [id1,id2,...] (where id is 'app_id' or 'app_id.partition_id')", - "query-compact - query full compact status on the underlying storage engine", + "replica.query-compact [id1,id2,...] (where id is 'app_id' or 'app_id.partition_id')", + "replica.query-compact - query full compact status on the underlying storage engine", [this](const std::vector &args) { return exec_command_on_replica(args, true, [](const replica_ptr &rep) { return rep->query_manual_compact_state(); @@ -2262,8 +2263,8 @@ void replica_stub::register_ctrl_command() _query_app_envs_command = ::dsn::command_manager::instance().register_command( {"replica.query-app-envs"}, - "query-app-envs [id1,id2,...] (where id is 'app_id' or 'app_id.partition_id')", - "query-app-envs - query app envs on the underlying storage engine", + "replica.query-app-envs [id1,id2,...] (where id is 'app_id' or 'app_id.partition_id')", + "replica.query-app-envs - query app envs on the underlying storage engine", [this](const std::vector &args) { return exec_command_on_replica(args, true, [](const replica_ptr &rep) { std::map kv_map; @@ -2275,8 +2276,8 @@ void replica_stub::register_ctrl_command() #ifdef DSN_ENABLE_GPERF _release_tcmalloc_memory_command = ::dsn::command_manager::instance().register_command( {"replica.release-tcmalloc-memory"}, - "release-tcmalloc-memory ", - "release-tcmalloc-memory - control if try to release tcmalloc memory", + "replica.release-tcmalloc-memory ", + "replica.release-tcmalloc-memory - control if try to release tcmalloc memory", [this](const std::vector &args) { return remote_command_set_bool_flag( _release_tcmalloc_memory, "release-tcmalloc-memory", args); @@ -2284,7 +2285,7 @@ void replica_stub::register_ctrl_command() _max_reserved_memory_percentage_command = dsn::command_manager::instance().register_command( {"replica.mem-release-max-reserved-percentage"}, - "mem-release-max-reserved-percentage [num | DEFAULT]", + "replica.mem-release-max-reserved-percentage [num | DEFAULT]", "control tcmalloc max reserved but not-used memory percentage", [this](const std::vector &args) { std::string result("OK"); @@ -2312,7 +2313,7 @@ void replica_stub::register_ctrl_command() _max_concurrent_bulk_load_downloading_count_command = dsn::command_manager::instance().register_command( {"replica.max-concurrent-bulk-load-downloading-count"}, - "max-concurrent-bulk-load-downloading-count [num | DEFAULT]", + "replica.max-concurrent-bulk-load-downloading-count [num | DEFAULT]", "control stub max_concurrent_bulk_load_downloading_count", [this](const std::vector &args) { std::string result("OK");