[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-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;
 	}
 }
 


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