Skip to contentSkip to conversation

cluster/group/daemon app.c

Cluster-devel [email protected] 1 participant 1 message Aug 22, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: teigland at sourceware.org 2006-08-22 14:36:20

Modified files:
group/daemon : app.c

Log message:
When we're in X_BEGIN state, accept "stopped" messages from other nodes. This applies to bz 202635.
(There may be a better way to address this, e.g. forcing a new FAIL_BEGIN event to be processed before processing any messages)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/app.c.diff?cvsroot=cluster&r1=1.40&r2=1.41

group/daemon/app.c +15 -2
@@ -787,6 +787,15 @@
 }
 #endif
 
+int event_state_begin(app_t *a)
+{
+	if (a->current_event->state == EST_JOIN_BEGIN ||
+	    a->current_event->state == EST_LEAVE_BEGIN ||
+	    a->current_event->state == EST_FAIL_BEGIN)
+		return TRUE;
+	return FALSE;
+}
+
 int event_state_stopping(app_t *a)
 {
 	if (a->current_event->state == EST_JOIN_STOP_WAIT ||
@@ -1058,8 +1067,12 @@
 {
 	node_t *node;
 
-	if (!event_state_stopping(a)) {
-		log_error(a->g, "mark_node_stopped: event not stopping: "
+	/* we might get a stopped message from another node who's going
+	   through X_BEGIN before we get to X_BEGIN ourselves, so we need
+	   to accept their message if we're in X_BEGIN, too */
+
+	if (!event_state_stopping(a) && !event_state_begin(a)) {
+		log_error(a->g, "mark_node_stopped: event not stopping/begin: "
 			  "state %s from %d",
 			  ev_state_str(a->current_event), nodeid);
 		return -1;