summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavishankar N <root@ravi2.(none)>2015-12-02 08:20:46 +0000
committerAtin Mukherjee <amukherj@redhat.com>2015-12-09 22:42:44 -0800
commitd57a5a57b8e87caffce94ed497240b37172f4a27 (patch)
treebcabeeb1bcfbfb82575f8f0ef7d4836b4a355491
parentdb3ff1e75f6d6cf80967708778f36ae07ddb220a (diff)
glusterd: add pending_node only if hxlator_count is valid
Fixes a regression introduced by commit 0ef62933649392051e73fe01c028e41baddec489 . See BZ for bug description. Problem: To perform GLUSTERD_BRICK_XLATOR_OP, the rpc requires number of xlators (n) the op needs to be performed on and the xlator names are populated in dictionary with xl-0, xl-1... xl-n-1 as keys. When Volume heal full is executed, for each replica group, glustershd on the local node may or may not be selected to perform heal by glusterd. XLATOR_OP rpc should be sent to the shd running on the same node by glusterd only when glustershd on that node is selected at least once. This bug occurs when glusterd sends the rpc to local glustershd even when it is not selected for any of the replica groups. Fix: Don't send the rpc to local glustershd when it is not selected even once. Change-Id: I2c8217a8f00f6ad5d0c6a67fa56e476457803e08 BUG: 1287503 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/12843 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index ec635e22577..b5dae564926 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -6514,18 +6514,6 @@ glusterd_bricks_select_heal_volume (dict_t *dict, char **op_errstr,
goto out;
}
- pending_node = GF_CALLOC (1, sizeof (*pending_node),
- gf_gld_mt_pending_node_t);
- if (!pending_node) {
- ret = -1;
- goto out;
- } else {
- pending_node->node = &(priv->shd_svc);
- pending_node->type = GD_NODE_SHD;
- cds_list_add_tail (&pending_node->list, selected);
- pending_node = NULL;
- }
-
if (!hxlator_count)
goto out;
if (hxlator_count == -1) {
@@ -6539,7 +6527,17 @@ glusterd_bricks_select_heal_volume (dict_t *dict, char **op_errstr,
ret = dict_set_int32 (dict, "count", hxlator_count);
if (ret)
goto out;
-
+ pending_node = GF_CALLOC (1, sizeof (*pending_node),
+ gf_gld_mt_pending_node_t);
+ if (!pending_node) {
+ ret = -1;
+ goto out;
+ } else {
+ pending_node->node = &(priv->shd_svc);
+ pending_node->type = GD_NODE_SHD;
+ cds_list_add_tail (&pending_node->list, selected);
+ pending_node = NULL;
+ }
out:
gf_msg_debug (THIS->name, 0, "Returning ret %d", ret);