[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/group/daemon cpg.c joinleave.c main.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland sourceware org	2007-09-07 19:17:27

Modified files:
	group/daemon   : cpg.c joinleave.c main.c 

Log message:
	Do nodedown events when the confchg for the groupd cpg arrives,
	instead of when the per-group cpg confchg's arrive.  This means
	all nodes should have agreed ordering on the sequence of confchg's
	and messages, since all messages go through the groupd cpg.
	
	This should fix bz 258121 but I can't reproduce anything like that
	bug to verify.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/cpg.c.diff?cvsroot=cluster&r1=1.38&r2=1.39
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/joinleave.c.diff?cvsroot=cluster&r1=1.21&r2=1.22
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/main.c.diff?cvsroot=cluster&r1=1.58&r2=1.59

--- cluster/group/daemon/cpg.c	2007/01/05 18:49:00	1.38
+++ cluster/group/daemon/cpg.c	2007/09/07 19:17:27	1.39
@@ -40,13 +40,11 @@
 	event_t *ev, *ev_safe;
 	int no_rev = 0;
 
-	log_group(g, "process_node_down %d", nodeid);
-
 	node = find_group_node(g, nodeid);
-	if (!node) {
-		log_error(g, "process_node_down: no member %d", nodeid);
+	if (!node)
 		return;
-	}
+
+	log_group(g, "process_node_down %d", nodeid);
 
 	list_del(&node->list);
 	g->memb_count--;
@@ -187,6 +185,7 @@
 
 void process_groupd_confchg(void)
 {
+	group_t *g;
 	struct recovery_set *rs;
 	int i, found = 0;
 	uint32_t gid;
@@ -248,6 +247,18 @@
 		}
 		groupd_down(saved_left[i].nodeid);
 	}
+
+	/* we call process_node_down from here, instead of from the other cpg
+	   confchg's because we want everyone to see the same order of
+	   confchg's with respect to messages.  see bz 258121 */
+
+	for (i = 0; i < saved_left_count; i++) {
+		if (saved_left[i].reason == CPG_REASON_NODEDOWN ||
+		    saved_left[i].reason == CPG_REASON_PROCDOWN) {
+			list_for_each_entry(g, &gd_groups, list)
+				process_node_down(g, saved_left[i].nodeid);
+		}
+	}
 }
 
 void copy_groupd_data(group_data_t *data)
@@ -389,7 +400,7 @@
 			break;
 		case CPG_REASON_NODEDOWN:
 		case CPG_REASON_PROCDOWN:
-			process_node_down(g, saved_left[i].nodeid);
+			/* process_node_down(g, saved_left[i].nodeid); */
 			break;
 		default:
 			log_error(g, "unknown leave reason %d node %d",
--- cluster/group/daemon/joinleave.c	2007/08/28 16:51:39	1.21
+++ cluster/group/daemon/joinleave.c	2007/09/07 19:17:27	1.22
@@ -135,10 +135,11 @@
 		return -EBUSY;
 	}
 
-	if (g->app->current_event &&
-	    g->app->current_event->nodeid == our_nodeid) {
+	ev = g->app->current_event;
+
+	if (ev && ev->nodeid == our_nodeid) {
 		log_error(g, "leave: busy event %llx state %s",
-			  ev->id, ev_state_str(g->app->current_event));
+			  ev->id, ev_state_str(ev));
 		return -EAGAIN;
 	}
 
--- cluster/group/daemon/main.c	2007/08/20 14:50:30	1.58
+++ cluster/group/daemon/main.c	2007/09/07 19:17:27	1.59
@@ -238,6 +238,7 @@
 		type = NODE_FAILED;
 	else {
 		/* report error */
+		type = -1;
 	}
 
 	/* start <name> <event_nr> <type> <count> <memb0> <memb1>... */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]