cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] cluster/group/daemon app.c gd_internal.h main.c
@ 2006-09-12 21:57 teigland
  0 siblings, 0 replies; 2+ messages in thread
From: teigland @ 2006-09-12 21:57 UTC (permalink / raw)
  To: cluster-devel.redhat.com

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:



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Cluster-devel] cluster/group/daemon app.c gd_internal.h main.c
@ 2006-10-04 15:52 teigland
  0 siblings, 0 replies; 2+ messages in thread
From: teigland @ 2006-10-04 15:52 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland at sourceware.org	2006-10-04 15:52:24

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

Log message:
	set the "member" field in the group_data struct that's returned
	when querying for group information

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

--- cluster/group/daemon/app.c	2006/09/26 21:32:38	1.47
+++ cluster/group/daemon/app.c	2006/10/04 15:52:24	1.48
@@ -629,7 +629,7 @@
 	return NULL;
 }
 
-static int is_our_join(event_t *ev)
+int is_our_join(event_t *ev)
 {
 	return (ev->nodeid == our_nodeid);
 }
--- cluster/group/daemon/gd_internal.h	2006/09/26 21:32:38	1.42
+++ cluster/group/daemon/gd_internal.h	2006/10/04 15:52:24	1.43
@@ -257,6 +257,7 @@
 struct recovery_set *get_recovery_set(int nodeid);
 void groupd_down(int nodeid);
 char *msg_type(int type);
+int is_our_join(event_t *ev);
 
 /* main.c */
 void app_stop(app_t *a);
--- cluster/group/daemon/main.c	2006/09/26 21:32:38	1.46
+++ cluster/group/daemon/main.c	2006/10/04 15:52:24	1.47
@@ -439,6 +439,7 @@
 static void copy_group_data(group_t *g, group_data_t *data)
 {
 	node_t *node;
+	event_t *ev;
 	int i = 0;
 
 	strncpy(data->client_name, client[g->app->client].type, 32);
@@ -472,6 +473,16 @@
 	list_for_each_entry(node, &g->app->nodes, list) {
 		data->members[i] = node->nodeid;
 		i++;
+
+		if (node->nodeid == our_nodeid)
+			data->member = 1;
+	}
+
+	/* we're in the member list but are still joining */
+	if (data->member) {
+		ev = g->app->current_event;
+		if (ev && is_our_join(ev))
+			data->member = 0;
 	}
 }
 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-10-04 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-12 21:57 [Cluster-devel] cluster/group/daemon app.c gd_internal.h main.c teigland
  -- strict thread matches above, loose matches on Subject: below --
2006-10-04 15:52 teigland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).