cluster: RHEL6 - If we see a JOIN message from ourselves, move ourselves to the end of the membership list.

Ryan McCabe rmccabe at fedoraproject.org
Tue May 1 15:01:45 UTC 2012


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=bc516e029691845a7c63adfe094d67069df920ab
Commit:        bc516e029691845a7c63adfe094d67069df920ab
Parent:        d764a6befb0e8edcf8a2c797164b98a5b272a565
Author:        Ryan McCabe <rmccabe at redhat.com>
AuthorDate:    Tue Apr 24 12:56:24 2012 -0400
Committer:     Ryan McCabe <rmccabe at redhat.com>
CommitterDate: Tue May 1 10:59:32 2012 -0400

If we see a JOIN message from ourselves, move ourselves to the end of the membership list.

Signed-off-by: Ryan McCabe <rmccabe at redhat.com>
Reviewed-by: Lon Hohberger <lhh at redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto at redhat.com>
---
 rgmanager/src/daemons/cpglockd.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/rgmanager/src/daemons/cpglockd.c b/rgmanager/src/daemons/cpglockd.c
index 7d4882d..2e35f7f 100644
--- a/rgmanager/src/daemons/cpglockd.c
+++ b/rgmanager/src/daemons/cpglockd.c
@@ -1094,8 +1094,16 @@ process_join(struct cpg_lock_msg *m, uint32_t nodeid, uint32_t pid)
 
 	list_for(&group_members, n, x) {
 		if (n->nodeid == nodeid) {
-			logt_print(LOG_DEBUG, "IGNORING JOIN from existing member %d.%d (%d.%d)\n",
-				nodeid, pid, nodeid, n->pid);
+			if (n->pid == pid) {
+				logt_print(LOG_DEBUG, "Saw JOIN from self (%d.%d)\n",
+					nodeid, pid);
+				list_remove(&group_members, n);
+				list_append(&group_members, n);
+			} else {
+				logt_print(LOG_DEBUG,
+					"IGNORING JOIN from existing member %d.%d (%d.%d)\n",
+					nodeid, pid, nodeid, n->pid);
+			}
 			return 0;
 		}
 	}


More information about the cluster-commits mailing list