summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2016-10-19 12:53:35 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-10-21 02:25:44 -0700
commit9565222c3bb17d124e3d62ec0ab987ce45999047 (patch)
tree47e6736006c875178926117599a76e46ac431e05 /xlators/mgmt/glusterd
parentee4c768dafda992ab6bf3787b4efc8b0f330623e (diff)
glusterd: conditionally pass uuid for EVENT_PEER_CONNECT
When a new node is probed, on the first RPC_CLNT_CONNECT peerctx->uuid is set to NULL as the same is yet to be populated. However the subesquent (dis)connect events would be carrying the valid UUIDs. Solution is not to generate EVENT_PEER_CONNECT on a peer probe trigger as CLI is already going to take care of generating the same. Change-Id: I2f0de054ca09f12013a6afdd8ee158c0307796b9 BUG: 1386516 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/15678 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Samikshan Bairagya <samikshan@gmail.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 50649795f70..de671c7f372 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -5743,9 +5743,16 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
peerinfo->generation = uatomic_add_return
(&conf->generation, 1);
peerctx->peerinfo_gen = peerinfo->generation;
- gf_event (EVENT_PEER_CONNECT, "host=%s;uuid=%s",
- peerinfo->hostname, uuid_utoa (peerinfo->uuid));
-
+ /* EVENT_PEER_CONNECT will only be sent if peerctx->uuid is not
+ * NULL, otherwise it indicates this RPC_CLNT_CONNECT is from a
+ * peer probe trigger and given we already generate an event for
+ * peer probe this would be unnecessary.
+ */
+ if (!gf_uuid_is_null (peerinfo->uuid)) {
+ gf_event (EVENT_PEER_CONNECT, "host=%s;uuid=%s",
+ peerinfo->hostname,
+ uuid_utoa (peerinfo->uuid));
+ }
ret = glusterd_peer_dump_version (this, rpc, peerctx);
if (ret)
gf_msg (this->name, GF_LOG_ERROR, 0,