diff options
author | shishir gowda <shishirng@gluster.com> | 2012-04-12 15:32:05 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-04-13 00:52:09 -0700 |
commit | b19a7fee17ddedfc6692deb5a8dc8df927a2cf7b (patch) | |
tree | 0f26493da3e1da1f9ee9cab5308504bf02083cc3 /cli/src/cli-rpc-ops.c | |
parent | bada6aeb2cabd12a11b0fe17bb01e9f2045b013d (diff) |
dht/rebalance: Display migration failure count
Change-Id: Ib2f8be2c98eae1b4df5d2090c1f1eec8ab264a35
BUG: 811923
Signed-off-by: shishir gowda <shishirng@gluster.com>
Reviewed-on: http://review.gluster.com/3135
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/src/cli-rpc-ops.c')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index a7450c32e60..4a1ff22b8ef 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -1016,6 +1016,7 @@ gf_cli3_1_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov, char *node_uuid = NULL; char key[256] = {0,}; int32_t i = 1; + uint64_t failures = 0; if (-1 == req->rpc_status) { goto out; @@ -1114,10 +1115,10 @@ gf_cli3_1_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov, goto done; } } - cli_out ("%40s %16s %13s %13s %14s", "Node", "Rebalanced-files", - "size", "scanned", "status"); - cli_out ("%40s %16s %13s %13s %14s", "---------", "-----------", - "-----------", "-----------", "------------"); + cli_out ("%40s %16s %13s %13s %13s %14s", "Node", "Rebalanced-files", + "size", "scanned", "failures","status"); + cli_out ("%40s %16s %13s %13s %13s %14s", "---------", "-----------", + "-----------", "-----------", "-----------", "------------"); do { snprintf (key, 256, "node-uuid-%d", i); @@ -1154,6 +1155,13 @@ gf_cli3_1_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov, gf_log (THIS->name, GF_LOG_TRACE, "failed to get status"); + memset (key, 0, 256); + snprintf (key, 256, "failures-%d", i); + ret = dict_get_uint64 (dict, key, &failures); + if (ret) + gf_log (THIS->name, GF_LOG_TRACE, + "failed to get failures count"); + switch (status_rcd) { case GF_DEFRAG_STATUS_NOT_STARTED: status = "not started"; @@ -1171,8 +1179,9 @@ gf_cli3_1_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov, status = "failed"; break; } - cli_out ("%40s %16"PRId64 "%13"PRId64 "%13"PRId64 "%14s", node_uuid, files, - size, lookup, status); + cli_out ("%40s %16"PRId64 "%13"PRId64 "%13"PRId64 "%13"PRId64 + " %14s", node_uuid, files, size, lookup, failures, + status); i++; } while (i <= counter); @@ -1421,6 +1430,7 @@ gf_cli3_remove_brick_status_cbk (struct rpc_req *req, struct iovec *iov, int32_t counter = 0; char *node_uuid = 0; gf_defrag_status_t status_rcd = GF_DEFRAG_STATUS_NOT_STARTED; + uint64_t failures = 0; if (-1 == req->rpc_status) { @@ -1466,10 +1476,10 @@ gf_cli3_remove_brick_status_cbk (struct rpc_req *req, struct iovec *iov, } - cli_out ("%40s %16s %13s %13s %14s", "Node", "Rebalanced-files", - "size", "scanned", "status"); - cli_out ("%40s %16s %13s %13s %14s", "---------", "-----------", - "-----------", "-----------", "------------"); + cli_out ("%40s %16s %13s %13s %13s %14s", "Node", "Rebalanced-files", + "size", "scanned", "failures", "status"); + cli_out ("%40s %16s %13s %13s %13s %14s", "---------", "-----------", + "-----------", "-----------", "-----------", "------------"); do { snprintf (key, 256, "node-uuid-%d", i); @@ -1506,6 +1516,12 @@ gf_cli3_remove_brick_status_cbk (struct rpc_req *req, struct iovec *iov, gf_log (THIS->name, GF_LOG_TRACE, "failed to get status"); + snprintf (key, 256, "failures-%d", i); + ret = dict_get_uint64 (dict, key, &failures); + if (ret) + gf_log (THIS->name, GF_LOG_TRACE, + "Failed to get failure on files"); + switch (status_rcd) { case GF_DEFRAG_STATUS_NOT_STARTED: status = "not started"; @@ -1523,8 +1539,9 @@ gf_cli3_remove_brick_status_cbk (struct rpc_req *req, struct iovec *iov, status = "failed"; break; } - cli_out ("%40s %16"PRId64 "%13"PRId64 "%13"PRId64 "%14s", node_uuid, files, - size, lookup, status); + cli_out ("%40s %16"PRId64 "%13"PRId64 "%13"PRId64 "%13"PRId64 + " %14s", node_uuid, files, size, lookup, failures, + status); i++; } while (i <= counter); |