summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorhari <hgowtham@redhat.com>2016-04-06 16:16:47 +0530
committerDan Lambright <dlambrig@redhat.com>2016-04-22 08:12:39 -0700
commit8918c35434f5af98d63180163081b175c3236e91 (patch)
tree29ca3d464becea1fa063427a373d811420751ad1 /cli
parentadc8aeb16cdee8d2f58aa8f2fce1dd637f264e51 (diff)
Tier: tier command fails message when any node is down
back-port of : http://review.gluster.org/#/c/13918/ 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> Change-Id: Ia23df47596adb24816de4a2a1c8db875f145838e BUG: 1328410 Signed-off-by: hari <hgowtham@redhat.com> Reviewed-on: http://review.gluster.org/14030 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: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-rpc-ops.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 9bef143..a2519e8 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -1557,10 +1557,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)
@@ -1682,10 +1690,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)