Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
fix: incorrect help info of meta/replica remote commands (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu Tao authored and neverchanje committed Apr 7, 2021
1 parent c1d41d9 commit 9a3ed20
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 31 deletions.
10 changes: 5 additions & 5 deletions src/meta/greedy_load_balancer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ 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 <true|false>",
"meta.lb.balancer_in_turn <true|false>",
"control whether do app balancer in turn",
[this](const std::vector<std::string> &args) {
return remote_command_set_bool_flag(_balancer_in_turn, "lb.balancer_in_turn", args);
});

_ctrl_only_primary_balancer = dsn::command_manager::instance().register_command(
{"meta.lb.only_primary_balancer"},
"lb.only_primary_balancer <true|false>",
"meta.lb.only_primary_balancer <true|false>",
"control whether do only primary balancer",
[this](const std::vector<std::string> &args) {
return remote_command_set_bool_flag(
Expand All @@ -110,21 +110,21 @@ 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 <true|false>",
"meta.lb.only_move_primary <true|false>",
"control whether only move primary in balancer",
[this](const std::vector<std::string> &args) {
return remote_command_set_bool_flag(_only_move_primary, "lb.only_move_primary", args);
});

_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<std::string> &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 <get|set|clear> [app_id1,app_id2..]",
"meta.lb.ignored_app_list <get|set|clear> [app_id1,app_id2..]",
"get, set and clear balancer ignored_app_list",
[this](const std::vector<std::string> &args) {
return remote_command_balancer_ignored_app_ids(args);
Expand Down
2 changes: 1 addition & 1 deletion src/meta/meta_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> &args) {
std::string result("OK");
Expand Down
4 changes: 2 additions & 2 deletions src/meta/server_load_balancer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> &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 [<ip:port,ip:port,ip:port>|clear]",
"meta.lb.assign_secondary_black_list [<ip:port,ip:port,ip:port>|clear]",
"control the assign secondary black list",
[this](const std::vector<std::string> &args) {
return ctrl_assign_secondary_black_list(args);
Expand Down
8 changes: 4 additions & 4 deletions src/meta/server_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> &args) {
dsn::error_code err;
if (args.size() != 2) {
Expand All @@ -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 <true|false>",
"meta.lb.add_secondary_enable_flow_control <true|false>",
"control whether enable add secondary flow control",
[this](const std::vector<std::string> &args) {
return remote_command_set_bool_flag(
Expand All @@ -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<std::string> &args) {
std::string result("OK");
Expand Down
39 changes: 20 additions & 19 deletions src/replica/replica_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2109,8 +2109,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<std::string> &args) {
dsn::gpid pid;
if (args.size() == 0) {
Expand All @@ -2131,35 +2131,36 @@ void replica_stub::register_ctrl_command()

_deny_client_command = ::dsn::command_manager::instance().register_command(
{"replica.deny-client"},
"deny-client <true|false>",
"deny-client - control if deny client read & write request",
"replica.deny-client <true|false>",
"replica.deny-client - control if deny client read & write request",
[this](const std::vector<std::string> &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 <true|false>",
"verbose-client-log - control if print verbose error log when reply read & write "
"request",
"replica.verbose-client-log <true|false>",
"replica.verbose-client-log - control if print verbose error log when reply read & "
"write request",
[this](const std::vector<std::string> &args) {
return remote_command_set_bool_flag(
_verbose_client_log, "verbose-client-log", args);
});

_verbose_commit_log_command = ::dsn::command_manager::instance().register_command(
{"replica.verbose-commit-log"},
"verbose-commit-log <true|false>",
"verbose-commit-log - control if print verbose log when commit mutation",
"replica.verbose-commit-log <true|false>",
"replica.verbose-commit-log - control if print verbose log when commit mutation",
[this](const std::vector<std::string> &args) {
return remote_command_set_bool_flag(
_verbose_commit_log, "verbose-commit-log", args);
});

_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<std::string> &args) {
return exec_command_on_replica(args, true, [this](const replica_ptr &rep) {
tasking::enqueue(LPC_PER_REPLICA_CHECKPOINT_TIMER,
Expand All @@ -2172,8 +2173,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<std::string> &args) {
return exec_command_on_replica(args, true, [](const replica_ptr &rep) {
return rep->query_manual_compact_state();
Expand All @@ -2182,8 +2183,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<std::string> &args) {
return exec_command_on_replica(args, true, [](const replica_ptr &rep) {
std::map<std::string, std::string> kv_map;
Expand All @@ -2195,16 +2196,16 @@ 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 <true|false>",
"release-tcmalloc-memory - control if try to release tcmalloc memory",
"replica.release-tcmalloc-memory <true|false>",
"replica.release-tcmalloc-memory - control if try to release tcmalloc memory",
[this](const std::vector<std::string> &args) {
return remote_command_set_bool_flag(
_release_tcmalloc_memory, "release-tcmalloc-memory", args);
});

_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<std::string> &args) {
std::string result("OK");
Expand Down Expand Up @@ -2232,7 +2233,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<std::string> &args) {
std::string result("OK");
Expand Down

0 comments on commit 9a3ed20

Please sign in to comment.