All of lore.kernel.org
 help / color / mirror / Atom feed
From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/group/daemon app.c gd_internal.h main.c
Date: 12 Sep 2006 21:57:06 -0000	[thread overview]
Message-ID: <20060912215706.23237.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland at 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:



             reply	other threads:[~2006-09-12 21:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-12 21:57 teigland [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-10-04 15:52 [Cluster-devel] cluster/group/daemon app.c gd_internal.h main.c teigland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060912215706.23237.qmail@sourceware.org \
    --to=teigland@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.