summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorshishirng <shishirng@gluster.com>2012-03-06 18:55:37 +0530
committerVijay Bellur <vijay@gluster.com>2012-03-07 21:14:27 -0800
commit33e9f9da8546dc57ecf6b3705f6b6474150ec78c (patch)
tree9455c2dcd9f49e7ff8b50fdcc3fb6d8b0534c975 /cli
parentf6a779ffc5b515163995dc2d240c3271cc6bceeb (diff)
glusterd/rebalance: Bring in support for parallel rebalance
This patch, enables rebalance processes to be started on all nodes where the volume is spread across (1 process per node) node-uuid xattr identifies which node takes ownership of the task to migrate the file. The model employed is push (src pushes to dst) Change-Id: Ieacd46a6216cf6ded841bbaebd10cfaea51c16d6 BUG: 763844 Signed-off-by: shishirng <shishirng@gluster.com> Reviewed-on: http://review.gluster.com/2873 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-rpc-ops.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index e436024a9..977ab0b2a 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -976,6 +976,7 @@ gf_cli3_1_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov,
uint64_t size = 0;
uint64_t lookup = 0;
char msg[1024] = {0,};
+ gf_defrag_status_t status_rcd = GF_DEFRAG_STATUS_NOT_STARTED;
if (-1 == req->rpc_status) {
goto out;
@@ -1041,6 +1042,11 @@ gf_cli3_1_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov,
gf_log (THIS->name, GF_LOG_TRACE,
"failed to get lookedup file count");
+ ret = dict_get_int32 (dict, "status", (int32_t *)&status_rcd);
+ if (ret)
+ gf_log (THIS->name, GF_LOG_TRACE,
+ "failed to get status");
+
if (cmd == GF_DEFRAG_CMD_STOP) {
if (rsp.op_ret == -1) {
if (strcmp (rsp.op_errstr, ""))
@@ -1070,7 +1076,7 @@ gf_cli3_1_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov,
goto done;
}
- switch (rsp.op_errno) {
+ switch (status_rcd) {
case GF_DEFRAG_STATUS_NOT_STARTED:
status = "not started";
break;
@@ -1113,7 +1119,7 @@ done:
#if (HAVE_LIB_XML)
if (global_state->mode & GLUSTER_MODE_XML) {
ret = cli_xml_output_str ("volRebalance", msg, rsp.op_ret,
- rsp.op_errno, rsp.op_errstr);
+ status_rcd, rsp.op_errstr);
if (ret)
gf_log ("cli", GF_LOG_ERROR,
"Error outputting to xml");