From 8918c35434f5af98d63180163081b175c3236e91 Mon Sep 17 00:00:00 2001 From: hari Date: Wed, 6 Apr 2016 16:16:47 +0530 Subject: 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 >Reviewed-on: http://review.gluster.org/13918 >Smoke: Gluster Build System >Tested-by: hari gowtham >NetBSD-regression: NetBSD Build System >CentOS-regression: Gluster Build System >Reviewed-by: Kaushal M Change-Id: Ia23df47596adb24816de4a2a1c8db875f145838e BUG: 1328410 Signed-off-by: hari Reviewed-on: http://review.gluster.org/14030 Smoke: Gluster Build System Tested-by: hari gowtham NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Dan Lambright --- cli/src/cli-rpc-ops.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'cli/src/cli-rpc-ops.c') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 9bef143574c..a2519e8c0e8 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) -- cgit