summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2016-11-17 18:16:18 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-11-17 10:15:53 -0800
commit7579370add44ee7d6cd854584964706f7248c035 (patch)
tree7debd22613dc85068df465ed1c1b9b5d0ad0f28e /cli
parent65f785bb9b484e42eac39af0e468a0a9f46c8e99 (diff)
cli/rebalance: remove brick status is incorrect
If a remove brick operation is preceded by a fix-layout, running remove-brick status on a node which does not contain any of the bricks that were removed displays fix-layout status. The defrag_cmd variable was not updated in glusterd for the nodes not hosting removed bricks causing the status parsing to go wrong. This is now updated. Also made minor modifications to the spacing in the fix-layout status output. > Change-Id: Ib735ce26be7434cd71b76e4c33d9b0648d0530db > BUG: 1389697 > Signed-off-by: N Balachandran <nbalacha@redhat.com> > Reviewed-on: http://review.gluster.org/15749 > Smoke: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Atin Mukherjee <amukherj@redhat.com> (cherry picked from commit 35b085ba345cafb2b0ee978a4c4475ab0dcba5a6) Change-Id: I3da89c61da07bc5e037527aafc84d184dcd1f764 BUG: 1396109 Signed-off-by: N Balachandran <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/15870 Tested-by: Atin Mukherjee <amukherj@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-rpc-ops.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index d1df07219e3..c48efc8d47c 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -1609,6 +1609,7 @@ gf_cli_print_rebalance_status (dict_t *dict, enum gf_task_types task_type,
int min = 0;
int sec = 0;
gf_boolean_t down = _gf_false;
+ gf_boolean_t fix_layout = _gf_false;
ret = dict_get_int32 (dict, "count", &count);
if (ret) {
@@ -1626,10 +1627,20 @@ gf_cli_print_rebalance_status (dict_t *dict, enum gf_task_types task_type,
goto out;
}
- if (status_rcd >= GF_DEFRAG_STATUS_LAYOUT_FIX_STARTED) {
- cli_out ("%10s %40s %18s", "Node", "status",
+ /* Fix layout will be sent to all nodes for the volume
+ so every status should be of type
+ GF_DEFRAG_STATUS_LAYOUT_FIX*
+ */
+
+ if ((task_type == GF_TASK_TYPE_REBALANCE)
+ && (status_rcd >= GF_DEFRAG_STATUS_LAYOUT_FIX_STARTED)) {
+ fix_layout = _gf_true;
+ }
+
+ if (fix_layout) {
+ cli_out ("%20s %40s %18s", "Node", "status",
"run time in h:m:s");
- cli_out ("%10s %40s %18s", "---------", "-----------",
+ cli_out ("%20s %40s %18s", "---------", "-----------",
"------------");
} else {
cli_out ("%40s %16s %13s %13s %13s %13s %20s %18s",
@@ -1738,8 +1749,8 @@ gf_cli_print_rebalance_status (dict_t *dict, enum gf_task_types task_type,
min = ((int) elapsed % 3600) / 60;
sec = ((int) elapsed % 3600) % 60;
- if (status_rcd >= GF_DEFRAG_STATUS_LAYOUT_FIX_STARTED) {
- cli_out ("%10s %40s %8d:%d:%d", node_name, status_str,
+ if (fix_layout) {
+ cli_out ("%20s %40s %8d:%d:%d", node_name, status_str,
hrs, min, sec);
} else {
if (size_str) {