summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-handler.c
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2014-10-15 12:56:48 +0530
committerKaushal M <kaushal@redhat.com>2014-10-28 23:58:34 -0700
commit8df26e838c40f15bb2b26131d1533da339f5be3e (patch)
tree8cedea9c45b23e31e79ed1d3e503abebca3648f1 /xlators/mgmt/glusterd/src/glusterd-handler.c
parent27628b7b0950a673cfb5584c76d25c183f5be02f (diff)
glusterd: op state machine shouldn't use global peer list
Problem : op state machine was relying on the global peer list while sending lock/stage/unlock commit rpc requests to the peers in the cluster. Trusting on global peer list structure is dangerous as this structure gets modified if any peer modification command is attempted in the cluster when there is a ongoing transaction going through the state machine. An ideal usecase of this problem when rebalance is in progress and peer probe is executed rebalance op-sm and peer probe may run into race making peerinfo structure go for toss. Solution: Use local copy of peer list (xaction_peers) in glusterd op-sm. Change-Id: I1ff7118dc6a9a72633e2e87b7ab7bae1796595e0 BUG: 1152890 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/8932 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index d97cc4bdf32..46efb58f275 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -517,6 +517,7 @@ glusterd_op_txn_begin (rpcsvc_request_t *req, glusterd_op_t op, void *ctx,
char *err_str, size_t err_len)
{
int32_t ret = -1;
+ int npeers = 0;
dict_t *dict = NULL;
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
@@ -605,6 +606,10 @@ glusterd_op_txn_begin (rpcsvc_request_t *req, glusterd_op_t op, void *ctx,
local_locking_done:
+ INIT_LIST_HEAD (&priv->xaction_peers);
+
+ npeers = gd_build_peers_list (&priv->peers, &priv->xaction_peers, op);
+
/* If no volname is given as a part of the command, locks will
* not be held, hence sending stage event. */
if (volname || (priv->op_version < GD_OP_VERSION_3_6_0))