diff options
author | hari <hgowtham@redhat.com> | 2016-04-06 16:16:47 +0530 |
---|---|---|
committer | Kaushal M <kaushal@redhat.com> | 2016-04-19 03:13:17 -0700 |
commit | 690715bb3e341f673a71d1dc8b80bb35aa29c75d (patch) | |
tree | e41e670253cd635cfdff047f64174d25791fc817 /cli | |
parent | abd47f27848c9bb2bf5bc371367c3d41f526ad50 (diff) |
Tier: tier command fails message when any node is down
PROBLEM: the dict doesn't get set on the node if its down.
so while printing the output on cli we get a ENOENT
which ends in a tier command failed.
FIX: this patch skips the node that wasn't available
and carrys on with the next node for both tier status
and tier detach status.
Change-Id: I718a034b18b109748ec67f3ace56540c50650d23
BUG: 1324439
Signed-off-by: hari <hgowtham@redhat.com>
Reviewed-on: http://review.gluster.org/13918
Smoke: Gluster Build System <jenkins@build.gluster.com>
Tested-by: hari gowtham <hari.gowtham005@gmail.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 3bc21ff77d5..223ec4260aa 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -1579,10 +1579,18 @@ gf_cli_print_rebalance_status (dict_t *dict, enum gf_task_types task_type) snprintf (key, 256, "status-%d", i); ret = dict_get_int32 (dict, key, (int32_t *)&status_rcd); - if (ret) { + if (ret == -ENOENT) { gf_log ("cli", GF_LOG_TRACE, "count %d %d", count, i); gf_log ("cli", GF_LOG_TRACE, "failed to get status"); - goto out; + gf_log ("cli", GF_LOG_ERROR, "node down and has failed" + " to set dict"); + continue; + /* skip this node if value not available*/ + } else if (ret) { + gf_log ("cli", GF_LOG_TRACE, "count %d %d", count, i); + gf_log ("cli", GF_LOG_TRACE, "failed to get status"); + continue; + /* skip this node if value not available*/ } if (GF_DEFRAG_STATUS_NOT_STARTED == status_rcd) @@ -1704,10 +1712,17 @@ gf_cli_print_tier_status (dict_t *dict, enum gf_task_types task_type) snprintf (key, 256, "status-%d", i); ret = dict_get_int32 (dict, key, (int32_t *)&status_rcd); - if (ret) { + if (ret == -ENOENT) { gf_log ("cli", GF_LOG_TRACE, "count: %d, %d," "failed to get status", count, i); - goto out; + gf_log ("cli", GF_LOG_ERROR, "node down and has failed" + " to set dict"); + continue; + /*skipping this node as value unavailable*/ + } else if (ret) { + gf_log ("cli", GF_LOG_TRACE, "count: %d, %d," + "failed to get status", count, i); + continue; } if (GF_DEFRAG_STATUS_NOT_STARTED == status_rcd) |