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

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


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=74721309f73dc6dc38abd07dc7c08e0ecb8ec602
Commit:        74721309f73dc6dc38abd07dc7c08e0ecb8ec602
Parent:        3a0a018e2cf6227c6b57d05bb7da0aa0a11cb445
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Wed Sep 10 09:06:25 2008 +0100
Committer:     Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Wed Sep 10 09:06:25 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 alre

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 05e4b58..dc1d5af 100644
--- a/cman/daemon/ais.c
+++ b/cman/daemon/ais.c
@@ -450,7 +450,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 da3cc66..8adbc23 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -1727,9 +1727,13 @@ static void do_process_transition(int nodeid, char *data, int len)
 	node = find_node_by_nodeid(nodeid);
 	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