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

[Cluster-devel] cluster/group/daemon app.c gd_internal.h main.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland sourceware org	2006-09-12 21:57:05

Modified files:
	group/daemon   : app.c gd_internal.h main.c 

Log message:
	Use the event_nr arg provided in start_done to check if the start_done
	callback should be ignored; were ignoring the event_nr.  The check of
	the current event state covered it, but ended up producing an unnecessary
	warning in syslog.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/app.c.diff?cvsroot=cluster&r1=1.42&r2=1.43
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/gd_internal.h.diff?cvsroot=cluster&r1=1.38&r2=1.39
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/main.c.diff?cvsroot=cluster&r1=1.41&r2=1.42

--- cluster/group/daemon/app.c	2006/08/31 18:20:51	1.42
+++ cluster/group/daemon/app.c	2006/09/12 21:57:05	1.43
@@ -720,15 +720,23 @@
 	return send_stopped(g);
 }
 
-int do_startdone(char *name, int level)
+int do_startdone(char *name, int level, int event_nr)
 {
 	group_t *g;
+	event_t *ev = g->app->current_event;
+	char *state;
 
 	g = find_group_level(name, level);
 
-	if (!g->app->current_event || !event_state_starting(g->app)) {
-		log_error(g, "IGNORE startdone state %d",
-		    g->app->current_event ?  g->app->current_event->state : -1);
+	state = ev ? ev_state_str(ev) : "no-event";
+
+	if (!ev || ev->event_nr != event_nr) {
+		log_group(g, "ignore startdone %d state %s", event_nr, state);
+		return 0;
+	}
+
+	if (!event_state_starting(g->app)) {
+		log_error(g, "IGNORE startdone %d state %s", event_nr, state);
 		return 0;
 	}
 
--- cluster/group/daemon/gd_internal.h	2006/07/13 21:28:45	1.38
+++ cluster/group/daemon/gd_internal.h	2006/09/12 21:57:05	1.39
@@ -237,7 +237,7 @@
 int queue_app_leave(group_t *g, int nodeid);
 int queue_app_message(group_t *g, struct save_msg *save);
 int do_stopdone(char *name, int level);
-int do_startdone(char *name, int level);
+int do_startdone(char *name, int level, int event_nr);
 char *ev_state_str(event_t *ev);
 event_t *find_queued_recover_event(group_t *g);
 void extend_recover_event(group_t *g, event_t *ev, int nodeid);
--- cluster/group/daemon/main.c	2006/08/31 18:17:32	1.41
+++ cluster/group/daemon/main.c	2006/09/12 21:57:05	1.42
@@ -336,9 +336,9 @@
 		client = malloc(NALLOC * sizeof(struct client));
 	else {
 		client = realloc(client, (client_size + NALLOC) *
-				         sizeof(struct client));
+					 sizeof(struct client));
 		pollfd = realloc(pollfd, (client_size + NALLOC) *
-						 sizeof(struct pollfd));
+					 sizeof(struct pollfd));
 		if (!pollfd)
 			log_print("can't alloc for pollfd");
 	}
@@ -586,8 +586,8 @@
 		break;
 
 	case DO_START_DONE:
-		get_args(buf, &argc, argv, ' ', 2);
-		do_startdone(argv[1], client[ci].level);
+		get_args(buf, &argc, argv, ' ', 3);
+		do_startdone(argv[1], client[ci].level, atoi(argv[2]));
 		break;
 
 	case DO_SEND:


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