diff options
author | shishir gowda <sgowda@redhat.com> | 2013-07-26 11:59:12 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-07-30 23:55:59 -0700 |
commit | e306698b00d2d3e736cbc97a1383bfb5d3724796 (patch) | |
tree | dd560b044b5741d0b0d007cfdd01d50e7be47ac2 /cli | |
parent | 7e6432015afd758ca3fd9e32d3e62b29935b0874 (diff) |
cluster/dht: Treat migration failures due to space constraints as skipped
Currently rebalance/remove-brick op's display migration failed count even
for files which failed due to space issues (not enough space for file, or
migration leading to cluster imbalance)
These will now be counted as skipped, and rebalance/remove-brick status
will display the additional counter
Change-Id: I674904d380b5f8300e9ca9e6af557c3d30d6cff4
BUG: 989846
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.org/5399
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 0205b4cc618..ea80f9362be 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -1206,6 +1206,7 @@ gf_cli_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov, char key[256] = {0,}; int32_t i = 1; uint64_t failures = 0; + uint64_t skipped = 0; double elapsed = 0; char *size_str = NULL; char *task_id_str = NULL; @@ -1326,11 +1327,12 @@ gf_cli_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - cli_out ("%40s %16s %13s %13s %13s %14s %s", "Node", "Rebalanced-files", - "size", "scanned", "failures", "status", "run time in secs"); - cli_out ("%40s %16s %13s %13s %13s %14s %16s", "---------", + cli_out ("%40s %16s %13s %13s %13s %13s %14s %s", "Node", + "Rebalanced-files", "size", "scanned", "failures", "skipped", + "status", "run time in secs"); + cli_out ("%40s %16s %13s %13s %13s %13s %14s %16s", "---------", "-----------", "-----------", "-----------", "-----------", - "------------", "--------------"); + "-----------", "------------", "--------------"); do { snprintf (key, 256, "node-uuid-%d", i); ret = dict_get_str (dict, key, &node_uuid); @@ -1374,6 +1376,12 @@ gf_cli_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov, "failed to get failures count"); memset (key, 0, 256); + snprintf (key, 256, "skipped-%d", i); + ret = dict_get_uint64 (dict, key, &skipped); + if (ret) + gf_log (frame->this->name, GF_LOG_TRACE, + "failed to get skipped count"); + memset (key, 0, 256); snprintf (key, 256, "run-time-%d", i); ret = dict_get_double (dict, key, &elapsed); if (ret) @@ -1400,8 +1408,8 @@ gf_cli_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov, size_str = gf_uint64_2human_readable(size); cli_out ("%40s %16"PRIu64 " %13s" " %13"PRIu64 " %13"PRIu64 - " %14s %16.2f", node_uuid, files, size_str, lookup, - failures, status, elapsed); + " %13"PRIu64 " %14s %16.2f", node_uuid, files, + size_str, lookup, failures, skipped, status, elapsed); GF_FREE(size_str); i++; @@ -1717,6 +1725,7 @@ gf_cli3_remove_brick_status_cbk (struct rpc_req *req, struct iovec *iov, char *node_uuid = 0; gf_defrag_status_t status_rcd = GF_DEFRAG_STATUS_NOT_STARTED; uint64_t failures = 0; + uint64_t skipped = 0; double elapsed = 0; char *size_str = NULL; int32_t command = 0; @@ -1817,11 +1826,12 @@ xml_output: } - cli_out ("%40s %16s %13s %13s %13s %14s %s", "Node", "Rebalanced-files", - "size", "scanned", "failures", "status", "run-time in secs"); - cli_out ("%40s %16s %13s %13s %13s %14s %16s", "---------", + cli_out ("%40s %16s %13s %13s %13s %13s %14s %s", "Node", + "Rebalanced-files", "size", "scanned", "failures", "skipped", + "status", "run-time in secs"); + cli_out ("%40s %16s %13s %13s %13s %13s %14s %16s", "---------", "-----------", "-----------", "-----------", "-----------", - "------------", "--------------"); + "-----------","------------", "--------------"); do { snprintf (key, 256, "node-uuid-%d", i); @@ -1864,6 +1874,11 @@ xml_output: gf_log (frame->this->name, GF_LOG_TRACE, "Failed to get failure on files"); + snprintf (key, 256, "failures-%d", i); + ret = dict_get_uint64 (dict, key, &skipped); + if (ret) + gf_log (frame->this->name, GF_LOG_TRACE, + "Failed to get skipped files"); memset (key, 0, 256); snprintf (key, 256, "run-time-%d", i); ret = dict_get_double (dict, key, &elapsed); @@ -1893,8 +1908,9 @@ xml_output: if (strcmp (status, "not started")) { cli_out ("%40s %16"PRIu64 " %13s" " %13"PRIu64 " %13" - PRIu64 " %14s %16.2f", node_uuid, files, - size_str, lookup, failures, status, elapsed); + PRIu64 " %13"PRIu64 " %14s %16.2f", node_uuid, + files, size_str, lookup, failures, skipped, + status, elapsed); } GF_FREE(size_str); |