From dabfc3116ae59b331f967c090c0c51eb3f0355fd Mon Sep 17 00:00:00 2001 From: Mohamed Ashiq Liyazudeen Date: Wed, 10 Aug 2016 13:44:19 +0530 Subject: heal: New feature heal info summary to list the status of brick and count of entries to be healed Command output: Brick 192.168.2.8:/brick/1 Status: Connected Total Number of entries: 363 Number of entries in heal pending: 362 Number of entries in split-brain: 0 Number of entries possibly healing: 1 192.168.2.8:/brick/1 Connected 363 362 0 1 0 0 Change-Id: I40cb6f77a14131c9e41b292f4901b41a228863d7 BUG: 1261463 Signed-off-by: Mohamed Ashiq Liyazudeen Reviewed-on: https://review.gluster.org/12154 Smoke: Gluster Build System Tested-by: Karthik U S CentOS-regression: Gluster Build System Reviewed-by: Ravishankar N Reviewed-by: Atin Mukherjee --- cli/src/cli-cmd-parser.c | 5 +++++ cli/src/cli-cmd-volume.c | 11 +++++++++-- cli/src/cli-rpc-ops.c | 3 ++- 3 files changed, 16 insertions(+), 3 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 45cce7a9a79..4914425698f 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -3837,6 +3837,11 @@ cli_cmd_volume_heal_options_parse (const char **words, int wordcount, GF_SHD_OP_SPLIT_BRAIN_FILES); goto done; } + if (!strcmp (words[4], "summary")) { + ret = dict_set_int32 (dict, "heal-op", + GF_SHD_OP_HEAL_SUMMARY); + goto done; + } } if (!strcmp (words[3], "statistics")) { diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 7bf99eb5e12..c22573e6408 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -2770,7 +2770,8 @@ cli_print_brick_status (cli_volume_status_t *status) (op == GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK) || \ (op == GF_SHD_OP_INDEX_SUMMARY) || \ (op == GF_SHD_OP_SPLIT_BRAIN_FILES) || \ - (op == GF_SHD_OP_GRANULAR_ENTRY_HEAL_ENABLE)) + (op == GF_SHD_OP_GRANULAR_ENTRY_HEAL_ENABLE) || \ + (op == GF_SHD_OP_HEAL_SUMMARY)) int cli_launch_glfs_heal (int heal_op, dict_t *options) @@ -2823,6 +2824,12 @@ cli_launch_glfs_heal (int heal_op, dict_t *options) case GF_SHD_OP_GRANULAR_ENTRY_HEAL_DISABLE: runner_add_args (&runner, "granular-entry-heal-op", NULL); break; + case GF_SHD_OP_HEAL_SUMMARY: + runner_add_args (&runner, "info-summary", NULL); + if (global_state->mode & GLUSTER_MODE_XML) { + runner_add_args (&runner, "xml", NULL); + } + break; default: ret = -1; } @@ -3295,7 +3302,7 @@ struct cli_cmd volume_cmds[] = { { "volume heal [enable | disable | full |" "statistics [heal-count [replica ]] |" - "info [healed | heal-failed | split-brain] |" + "info [summary | healed | heal-failed | split-brain] |" "split-brain {bigger-file | latest-mtime |" "source-brick []} |" "granular-entry-heal {enable | disable}]", diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 1840b208431..fcb451a3c08 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -9173,11 +9173,12 @@ gf_cli_heal_volume_cbk (struct rpc_req *req, struct iovec *iov, case GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA: heal_op_str = "count of entries to be healed per replica"; break; - /* The below 3 cases are never hit; they're coded only to make + /* The below 4 cases are never hit; they're coded only to make * compiler warnings go away.*/ case GF_SHD_OP_SBRAIN_HEAL_FROM_BIGGER_FILE: case GF_SHD_OP_SBRAIN_HEAL_FROM_LATEST_MTIME: case GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK: + case GF_SHD_OP_HEAL_SUMMARY: break; case GF_SHD_OP_INVALID: -- cgit