summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2015-05-22 18:38:23 +0530
committerKaushal M <kaushal@redhat.com>2015-05-27 01:28:27 -0700
commitd1ff9dead1f26151f89d154fab8252437601d22f (patch)
treec143e0430d2cdf955c5ac4ed5d9be314837536b4
parent158b047f7949d4fd1682fcb8f0722ddb28785bfa (diff)
glusterd: Fix conf->generation to stop new peers participating in
a transaction, while the transaction is in progress. 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: Ie25e3ecf59b19535b9cded7449e944221fac97a0 BUG: 1224290 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10895 Reviewed-by: Kaushal M <kaushal@redhat.com> Tested-by: Kaushal M <kaushal@redhat.com>
-rwxr-xr-xrun-tests.sh6
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c3
2 files changed, 4 insertions, 5 deletions
diff --git a/run-tests.sh b/run-tests.sh
index f578ced4acf..ccc52f32997 100755
--- a/run-tests.sh
+++ b/run-tests.sh
@@ -194,18 +194,14 @@ function run_tests()
function is_bad_test ()
{
local name=$1
- for bt in ./tests/basic/volume-snapshot-clone.t \
- ./tests/basic/uss.t \
+ for bt in ./tests/basic/uss.t \
./tests/bugs/replicate/bug-1015990.t \
./tests/basic/ec/quota.t \
./tests/basic/tier/tier.t \
./tests/basic/quota-nfs.t \
./tests/bugs/quota/bug-1035576.t \
- ./tests/basic/uss.t \
./tests/bugs/glusterfs/bug-867253.t \
- ./tests/basic/volume-snapshot-clone.t \
./tests/basic/quota-anon-fd-nfs.t \
- ./tests/bugs/snapshot/bug-1112559.t \
./tests/bugs/disperse/bug-1187474.t \
./tests/basic/afr/sparse-file-self-heal.t \
./tests/basic/mount-nfs-auth.t \
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)