summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2018-01-22 09:49:34 +0530
committerjiffin tony Thottan <jthottan@redhat.com>2018-02-02 06:48:39 +0000
commitc949870a7fb2179f8e75ab070a5eae4fc11f78b3 (patch)
tree660253555bc4ee56aa551640865b6245e882b716
parent35e2168a3cd8fb226701b5d3bac4507924db4a36 (diff)
glusterd: process pmap sign in only when port is marked as free
Because of some crazy race in volume start code path because of friend handshaking with volumes with quorum enabled we might end up into a situation where glusterd would start a brick and get a disconnect and then immediately try to start the same brick instance based on another friend update request. And then if for the very first brick even if the process doesn't come up at the end sign in event gets sent and we end up having two duplicate portmap entries for the same brick. Since in brick start we mark the previous port as free, its better to consider a sign in request as no op if the corresponding port type is marked as free. >mainline patch : https://review.gluster.org/#/c/19263/ Change-Id: I995c348c7b6988956d24b06bf3f09ab64280fc32 BUG: 1537346 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> (cherry picked from commit 9d708a3739c8201d23f996c413d6b08f8b13dd90)
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-pmap.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-pmap.c b/xlators/mgmt/glusterd/src/glusterd-pmap.c
index 16c4703f53a..8c20133708e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-pmap.c
+++ b/xlators/mgmt/glusterd/src/glusterd-pmap.c
@@ -265,6 +265,21 @@ pmap_registry_bind (xlator_t *this, int port, const char *brickname,
goto out;
p = port;
+ if (pmap->ports[p].type == GF_PMAP_PORT_FREE) {
+ /* Because of some crazy race in volume start code path because
+ * of friend handshaking with volumes with quorum enabled we
+ * might end up into a situation where glusterd would start a
+ * brick and get a disconnect and then immediately try to start
+ * the same brick instance based on another friend update
+ * request. And then if for the very first brick even if the
+ * process doesn't come up at the end sign in event gets sent
+ * and we end up having two duplicate portmap entries for the
+ * same brick. Since in brick start we mark the previous port as
+ * free, its better to consider a sign in request as no op if
+ * the corresponding port type is marked as free
+ */
+ goto out;
+ }
if (pmap->ports[p].brickname) {
char *tmp = pmap->ports[p].brickname;
asprintf (&pmap->ports[p].brickname, "%s %s", tmp, brickname);