From c550ae69526ad60b2f288ddc98a59141b9e64dcc Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Fri, 13 Sep 2013 18:48:38 +0530 Subject: cli/glusterd: improve rebalance fix-layout status reporting Problem: Currenly the CLI rebalance status command output does not indicate the 'type' of rebalance, i.e. whether a full rebalance or only a fix-layout was carried out. Fix: After the rebalance status of all peers is received by the originator glusterd, alter it to reflect the type of rebalance before passing it on to the CLI process. Change-Id: I1940ffda0d36e25e5b33c84a0ea210394cc9e1d3 BUG: 1004744 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/5826 Reviewed-by: Krishnan Parthasarathi Tested-by: Gluster Build System Reviewed-by: Anand Avati --- cli/src/cli-rpc-ops.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'cli/src') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index c15e0e086..fe3db41b6 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -67,6 +67,10 @@ char *cli_vol_task_status_str[] = {"not started", "stopped", "completed", "failed", + "fix-layout in progress", + "fix-layout stopped", + "fix-layout completed", + "fix-layout failed", }; int32_t @@ -1334,10 +1338,10 @@ gf_cli_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - cli_out ("%40s %16s %13s %13s %13s %13s %14s %s", "Node", + cli_out ("%40s %16s %13s %13s %13s %13s %20s %18s", "Node", "Rebalanced-files", "size", "scanned", "failures", "skipped", "status", "run time in secs"); - cli_out ("%40s %16s %13s %13s %13s %13s %14s %16s", "---------", + cli_out ("%40s %16s %13s %13s %13s %13s %20s %18s", "---------", "-----------", "-----------", "-----------", "-----------", "-----------", "------------", "--------------"); do { @@ -1398,7 +1402,7 @@ gf_cli_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov, status = cli_vol_task_status_str[status_rcd]; size_str = gf_uint64_2human_readable(size); cli_out ("%40s %16"PRIu64 " %13s" " %13"PRIu64 " %13"PRIu64 - " %13"PRIu64 " %14s %16.2f", node_uuid, files, + " %13"PRIu64 " %20s %18.2f", node_uuid, files, size_str, lookup, failures, skipped, status, elapsed); GF_FREE(size_str); @@ -1892,6 +1896,8 @@ xml_output: case GF_DEFRAG_STATUS_FAILED: status = "failed"; break; + default: + break; } size_str = gf_uint64_2human_readable(size); -- cgit