diff options
author | Kaushal M <kaushal@redhat.com> | 2015-05-06 13:10:15 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-05-07 22:33:05 -0700 |
commit | 54f8ee45a5152bea73009accb569c90994f16f08 (patch) | |
tree | 9c5f5d416ca2c251d6d041beb9c5cfa89b41008c /xlators/mgmt/glusterd/src/glusterd-handler.c | |
parent | 613414e837cb5a09c3adbf2258ad691151f1c7e1 (diff) |
glusterd: Use generation number to find peerinfo in RPC notifications
The generation number for each peerinfo object is unique. It can be used
to find the exact peerinfo object, which is required for peer RPC
notifications.
Using hostname and uuid matching to find peerinfos can return incorrect
peerinfos to be returned in certain cases like multi network peer probe.
This could cause updates to happen to incorrect peerinfos.
Change-Id: Ia0aada8214fd6d43381e5afd282e08d53a277251
BUG: 1215018
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/10495
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
(cherry picked from commit 02583099a219ce327aac62af22b486c7b9fcb531)
Reviewed-on: http://review.gluster.org/10623
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 524ce35d841..fcdfa608607 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -3152,6 +3152,10 @@ glusterd_friend_rpc_create (xlator_t *this, glusterd_peerinfo_t *peerinfo, gf_uuid_copy (peerctx->peerid, peerinfo->uuid); peerctx->peername = gf_strdup (peerinfo->hostname); + peerctx->peerinfo_gen = peerinfo->generation; /* A peerinfos generation + number can be used to + uniquely identify a + peerinfo */ ret = glusterd_transport_inet_options_build (&options, peerinfo->hostname, @@ -4613,7 +4617,7 @@ glusterd_friend_remove_notify (glusterd_peerctx_t *peerctx) GF_ASSERT (peerctx); rcu_read_lock (); - peerinfo = glusterd_peerinfo_find (peerctx->peerid, peerctx->peername); + peerinfo = glusterd_peerinfo_find_by_generation (peerctx->peerinfo_gen); if (!peerinfo) { gf_log (THIS->name, GF_LOG_DEBUG, "Could not find peer %s(%s). " "Peer could have been deleted.", peerctx->peername, @@ -4684,7 +4688,7 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata, rcu_read_lock (); - peerinfo = glusterd_peerinfo_find (peerctx->peerid, peerctx->peername); + peerinfo = glusterd_peerinfo_find_by_generation (peerctx->peerinfo_gen); if (!peerinfo) { /* Peerinfo should be available at this point. Not finding it * means that something terrible has happened |