From 0bcd638b46a7134f0285b39aabfed9950645bdc3 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Fri, 22 May 2015 18:38:23 +0530 Subject: glusterd: Fix conf->generation to stop new peers participating in a transaction, while the transaction is in progress. Backport of http://review.gluster.org/#/c/10895/ Every peer gets a generation number, during it's inception. This generation number is used to identify the peer throiughout it's lifetime. This number is assigned based on the current generation number of the system, which is incremented with every peer that is added. The problem arises when we add a peer, and before it gets a rpc_connect we begin a transaction. In such a case, the peer gets considered in the transaction, but doesn't participate in it coz it isn't connected yet. The moment it gets the rpc notification and is connected, it starts participating in the transaction and all hell breaks loose. To resolve it, we should assign the peerinfo a new generation number everytime it's connected, so that this number will be greater than the generation number that the transaction is acting upon, and even though the peer is connected it will not participate in the transaction. We should also assign the new generation number of the peer to the peerctx, so that the framework that searches for peerinfos based on the generation number, will still function in the same manner. Removing ./tests/basic/volume-snapshot-clone.t from bad-tests. Also removed the duplicate entry of ./tests/bugs/snapshot/bug-1112559.t from bad-tests. Original entry was removed in http://review.gluster.org/10840 Change-Id: I57e5efe3217abfb96733e487aea3972e116d909d BUG: 1224292 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/10895 Reviewed-by: Kaushal M Tested-by: Kaushal M Reviewed-on: http://review.gluster.org/10937 Reviewed-by: Atin Mukherjee Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-handler.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 83fa799c2a5..b297ed16443 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -4791,6 +4791,9 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata, gf_log (this->name, GF_LOG_DEBUG, "got RPC_CLNT_CONNECT"); peerinfo->connected = 1; peerinfo->quorum_action = _gf_true; + peerinfo->generation = uatomic_add_return + (&conf->generation, 1); + peerctx->peerinfo_gen = peerinfo->generation; ret = glusterd_peer_dump_version (this, rpc, peerctx); if (ret) -- cgit