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>
This commit is contained in:
parent
7645411f13
commit
78bf67f6d1
@ -1235,8 +1235,12 @@ gf_cli_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov,
|
|||||||
goto done;
|
goto done;
|
||||||
} else {
|
} else {
|
||||||
snprintf (msg, sizeof (msg),
|
snprintf (msg, sizeof (msg),
|
||||||
"Stopped rebalance process on volume %s \n",
|
"rebalance process may be in the middle of a "
|
||||||
volname);
|
"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) {
|
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;
|
uint64_t failures = 0;
|
||||||
double elapsed = 0;
|
double elapsed = 0;
|
||||||
char *size_str = NULL;
|
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) {
|
if (-1 == req->rpc_status) {
|
||||||
goto out;
|
goto out;
|
||||||
@ -1664,14 +1673,33 @@ gf_cli3_remove_brick_status_cbk (struct rpc_req *req, struct iovec *iov,
|
|||||||
goto out;
|
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;
|
ret = rsp.op_ret;
|
||||||
if (rsp.op_ret == -1) {
|
if (rsp.op_ret == -1) {
|
||||||
if (strcmp (rsp.op_errstr, ""))
|
if (strcmp (rsp.op_errstr, ""))
|
||||||
snprintf (msg, sizeof (msg), "volume remove-brick: "
|
snprintf (msg, sizeof (msg), "volume remove-brick %s: "
|
||||||
"failed: %s", rsp.op_errstr);
|
"failed: %s", cmd_str, rsp.op_errstr);
|
||||||
else
|
else
|
||||||
snprintf (msg, sizeof (msg), "volume remove-brick: "
|
snprintf (msg, sizeof (msg), "volume remove-brick %s: "
|
||||||
"failed: status getting failed");
|
"failed", cmd_str);
|
||||||
|
|
||||||
if (global_state->mode & GLUSTER_MODE_XML)
|
if (global_state->mode & GLUSTER_MODE_XML)
|
||||||
goto xml_output;
|
goto xml_output;
|
||||||
@ -1805,6 +1833,15 @@ xml_output:
|
|||||||
i++;
|
i++;
|
||||||
} while (i <= counter);
|
} 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:
|
out:
|
||||||
free (rsp.dict.dict_val); //malloced by xdr
|
free (rsp.dict.dict_val); //malloced by xdr
|
||||||
if (dict)
|
if (dict)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user