From 33e9f9da8546dc57ecf6b3705f6b6474150ec78c Mon Sep 17 00:00:00 2001 From: shishirng Date: Tue, 6 Mar 2012 18:55:37 +0530 Subject: 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 Reviewed-on: http://review.gluster.com/2873 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- cli/src/cli-rpc-ops.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index e436024a98a..977ab0b2a13 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"); -- cgit