diff options
author | Kaushal M <kaushal@redhat.com> | 2013-03-20 10:52:08 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-03-20 19:54:34 -0700 |
commit | 78bf67f6d1caff4b56060a5029b0620f57634fc5 (patch) | |
tree | 6094130922b4e83d5924212881a7cdea43306c3c /cli/src | |
parent | 7645411f134c2b7ae004f0a8478449965e424a97 (diff) |
cli: Better message on rebalance/remove-brick stop
A better message is displayed when rebalance or remove-brick is stopped,
as migration may be still in progress.
Change-Id: I5f301cc66f349a1a85245f7d7508bf746756bdea
BUG: 923529
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/4695
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 49 |
1 files changed, 43 insertions, 6 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 62b949b1673..e99adc82557 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -1235,8 +1235,12 @@ gf_cli_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov, goto done; } else { snprintf (msg, sizeof (msg), - "Stopped rebalance process on volume %s \n", - volname); + "rebalance process may be in the middle of a " + "file migration.\nThe process will be fully " + "stopped once the migration of the file is " + "complete.\nPlease check rebalance process " + "for completion before doing any further " + "brick related tasks on the volume."); } } if (cmd == GF_DEFRAG_CMD_STATUS) { @@ -1652,6 +1656,11 @@ gf_cli3_remove_brick_status_cbk (struct rpc_req *req, struct iovec *iov, uint64_t failures = 0; double elapsed = 0; char *size_str = NULL; + int32_t command = 0; + gf1_op_commands cmd = GF_OP_CMD_NONE; + cli_local_t *local = NULL; + call_frame_t *frame = NULL; + char *cmd_str = "unknown"; if (-1 == req->rpc_status) { goto out; @@ -1664,14 +1673,33 @@ gf_cli3_remove_brick_status_cbk (struct rpc_req *req, struct iovec *iov, goto out; } + frame = myframe; + if (frame) + local = frame->local; + ret = dict_get_int32 (local->dict, "command", &command); + if (ret) + goto out; + cmd = command; + + switch (cmd) { + case GF_OP_CMD_STOP: + cmd_str = "stop"; + break; + case GF_OP_CMD_STATUS: + cmd_str = "status"; + break; + default: + break; + } + ret = rsp.op_ret; if (rsp.op_ret == -1) { if (strcmp (rsp.op_errstr, "")) - snprintf (msg, sizeof (msg), "volume remove-brick: " - "failed: %s", rsp.op_errstr); + snprintf (msg, sizeof (msg), "volume remove-brick %s: " + "failed: %s", cmd_str, rsp.op_errstr); else - snprintf (msg, sizeof (msg), "volume remove-brick: " - "failed: status getting failed"); + snprintf (msg, sizeof (msg), "volume remove-brick %s: " + "failed", cmd_str); if (global_state->mode & GLUSTER_MODE_XML) goto xml_output; @@ -1805,6 +1833,15 @@ xml_output: i++; } while (i <= counter); + if ((cmd == GF_OP_CMD_STOP) && (rsp.op_ret == 0)) { + cli_out ("'remove-brick' process may be in the middle of a " + "file migration.\nThe process will be fully stopped " + "once the migration of the file is complete.\nPlease " + "check remove-brick process for completion before " + "doing any further brick related tasks on the " + "volume."); + } + out: free (rsp.dict.dict_val); //malloced by xdr if (dict) |