This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=47904e93a289d674fb5a6815ba2a9e61ed1c34e9
Commit:        47904e93a289d674fb5a6815ba2a9e61ed1c34e9
Parent:        0fe671458adb14140effdfe1696ada14f9e5b339
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:09:53 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 76044c9..bce0f9f 100644
--- a/cman/daemon/ais.c
+++ b/cman/daemon/ais.c
@@ -298,7 +298,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 3497369..5a843b6 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -1810,9 +1810,13 @@ static void do_process_transition(int nodeid, char *data)
 	}
 	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) {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]