STABLE2 - cman: honour the dirty flag on a node we haven't seen before

Christine Caulfield chrissie@fedoraproject.org
Wed Sep 10 08:08:00 GMT 2008


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d23899a10e804a8a871a3f3510f4efb3ac9815a8
Commit:        d23899a10e804a8a871a3f3510f4efb3ac9815a8
Parent:        a67ddce0f321b800b68362bb96b5cf20081b483a
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Wed Sep 10 09:00:35 2008 +0100
Committer:     Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Wed Sep 10 09:00:35 2008 +0100

cman: honour the dirty flag on a node we haven't seen before

The dity-node code used to check if a node had been down before
honouring the dirty flag, this was to prevent nodes already in the cluster
from kicking each other out at a transition.

This had the problem that it could not detect if a new node joined that already had state (eg a new cluster started up in a split network).

So, now we also check the 'first_trans' flag in the transition message so
that we know when the node has newly joined a multi-node cluster.

For more information see bz#460909

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
 cman/daemon/ais.c      |    3 ++-
 cman/daemon/commands.c |    6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/cman/daemon/ais.c b/cman/daemon/ais.c
index 087448d..77cbf19 100644
--- a/cman/daemon/ais.c
+++ b/cman/daemon/ais.c
@@ -453,7 +453,8 @@ static void cman_confchg_fn(enum totem_configuration_type configuration_type,
 		P_AIS("last memb_count = %d, current = %d\n", last_memb_count, member_list_entries);
 		send_transition_msg(last_memb_count, first_trans);
 		last_memb_count = member_list_entries;
-		first_trans = 0;
+		if (member_list_entries > 1)
+			first_trans = 0;
 
 		cman_send_confchg(member_list,  member_list_entries,
 				  saved_left_list, saved_left_list_entries,
diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index f7fd269..162e8be 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -1719,9 +1719,13 @@ static void do_process_transition(int nodeid, char *data, int len)
 	}
 	assert(node);
 
+	P_MEMB("Got TRANSITION message. msg->flags=%x, node->flags=%x, first_trans=%d\n",
+	       msg->flags, node->flags, msg->first_trans);
+
 	/* Newer nodes 6.1.0 onwards, set the DIRTY flag if they have state. If the new node has been down
 	   and has state then we mark it disallowed because we cannot merge stateful nodes */
-	if (msg->flags & NODE_FLAGS_DIRTY && (node->flags & NODE_FLAGS_BEENDOWN)) {
+	if ( (msg->flags & NODE_FLAGS_DIRTY && (node->flags & NODE_FLAGS_BEENDOWN)) ||
+	     (msg->flags & NODE_FLAGS_DIRTY && msg->first_trans && !node->us)) {
 		/* Don't duplicate messages */
 		if (node->state != NODESTATE_AISONLY) {
 			if (cluster_is_quorate) {



More information about the Cluster-cvs mailing list