All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] cluster/fence/fenced member_cman.c
@ 2006-07-28 18:41 teigland
  0 siblings, 0 replies; 4+ messages in thread
From: teigland @ 2006-07-28 18:41 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland at sourceware.org	2006-07-28 18:41:00

Modified files:
	fence/fenced   : member_cman.c 

Log message:
	Update the cman member list every time we call is_member().  When
	called from the fence delay loop, we're not processing callbacks
	so our member list won't be updated as a result of a cman callback.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fenced/member_cman.c.diff?cvsroot=cluster&r1=1.13&r2=1.14

--- cluster/fence/fenced/member_cman.c	2006/07/25 20:05:52	1.13
+++ cluster/fence/fenced/member_cman.c	2006/07/28 18:41:00	1.14
@@ -193,6 +193,10 @@
 {
 	cman_node_t *cn;
 
+	/* Note: in fence delay loop we aren't processing callbacks so won't
+	   have done a statechange() in response to a cman callback */
+	statechange();
+
 	cn = find_cluster_node_name(name);
 	if (cn && cn->cn_member) {
 		if (in_groupd_cpg(cn->cn_nodeid))



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

* [Cluster-devel] cluster/fence/fenced member_cman.c
@ 2006-12-14 19:55 teigland
  0 siblings, 0 replies; 4+ messages in thread
From: teigland @ 2006-12-14 19:55 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland at sourceware.org	2006-12-14 19:55:25

Modified files:
	fence/fenced   : member_cman.c 

Log message:
	Switch from CMAN_DISPATCH_ONE loop to CMAN_DISPATCH_ALL to resolve
	delayed cman shutdown callbacks.
	bz 219385

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fenced/member_cman.c.diff?cvsroot=cluster&r1=1.15&r2=1.16

--- cluster/fence/fenced/member_cman.c	2006/10/09 10:52:50	1.15
+++ cluster/fence/fenced/member_cman.c	2006/12/14 19:55:24	1.16
@@ -16,8 +16,6 @@
 #define BUFLEN		128
 
 static cman_handle_t	ch;
-static int		cman_cb;
-static int		cman_reason;
 static int		cman_quorate;
 static cman_node_t	cman_nodes[MAX_NODES];
 static int		cman_node_count;
@@ -90,53 +88,31 @@
 		log_error("cman_get_nodes error %d %d", rv, errno);
 }
 
-static void process_cman_callback(void)
-{
-	switch (cman_reason) {
-	case CMAN_REASON_STATECHANGE:
-		statechange();
-		break;
-	default:
-		break;
-	}
-}
-
 static void cman_callback(cman_handle_t h, void *private, int reason, int arg)
 {
-	cman_cb = 1;
-	cman_reason = reason;
-
-	if (reason == CMAN_REASON_TRY_SHUTDOWN) {
+	switch (reason) {
+	case CMAN_REASON_TRY_SHUTDOWN:
 		if (list_empty(&domains))
 			cman_replyto_shutdown(ch, 1);
 		else {
 			log_debug("no to cman shutdown");
 			cman_replyto_shutdown(ch, 0);
 		}
+		break;
+	case CMAN_REASON_STATECHANGE:
+		statechange();
+		break;
 	}
 }
 
 int process_member(void)
 {
 	int rv;
-
-	while (1) {
-		rv = cman_dispatch(ch, CMAN_DISPATCH_ONE);
-		if (rv < 0)
-			break;
-
-		if (cman_cb) {
-			cman_cb = 0;
-			process_cman_callback();
-		} else
-			break;
-	}
-
+	rv = cman_dispatch(ch, CMAN_DISPATCH_ALL);
 	if (rv == -1 && errno == EHOSTDOWN) {
 		log_error("cluster is down, exiting");
 		exit(1);
 	}
-
 	return 0;
 }
 



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

* [Cluster-devel] cluster/fence/fenced member_cman.c
@ 2006-12-14 19:55 teigland
  0 siblings, 0 replies; 4+ messages in thread
From: teigland @ 2006-12-14 19:55 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	teigland at sourceware.org	2006-12-14 19:55:50

Modified files:
	fence/fenced   : member_cman.c 

Log message:
	Switch from CMAN_DISPATCH_ONE loop to CMAN_DISPATCH_ALL to resolve
	delayed cman shutdown callbacks.
	bz 219385

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fenced/member_cman.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.15&r2=1.15.2.1

--- cluster/fence/fenced/member_cman.c	2006/10/09 10:52:50	1.15
+++ cluster/fence/fenced/member_cman.c	2006/12/14 19:55:49	1.15.2.1
@@ -16,8 +16,6 @@
 #define BUFLEN		128
 
 static cman_handle_t	ch;
-static int		cman_cb;
-static int		cman_reason;
 static int		cman_quorate;
 static cman_node_t	cman_nodes[MAX_NODES];
 static int		cman_node_count;
@@ -90,53 +88,31 @@
 		log_error("cman_get_nodes error %d %d", rv, errno);
 }
 
-static void process_cman_callback(void)
-{
-	switch (cman_reason) {
-	case CMAN_REASON_STATECHANGE:
-		statechange();
-		break;
-	default:
-		break;
-	}
-}
-
 static void cman_callback(cman_handle_t h, void *private, int reason, int arg)
 {
-	cman_cb = 1;
-	cman_reason = reason;
-
-	if (reason == CMAN_REASON_TRY_SHUTDOWN) {
+	switch (reason) {
+	case CMAN_REASON_TRY_SHUTDOWN:
 		if (list_empty(&domains))
 			cman_replyto_shutdown(ch, 1);
 		else {
 			log_debug("no to cman shutdown");
 			cman_replyto_shutdown(ch, 0);
 		}
+		break;
+	case CMAN_REASON_STATECHANGE:
+		statechange();
+		break;
 	}
 }
 
 int process_member(void)
 {
 	int rv;
-
-	while (1) {
-		rv = cman_dispatch(ch, CMAN_DISPATCH_ONE);
-		if (rv < 0)
-			break;
-
-		if (cman_cb) {
-			cman_cb = 0;
-			process_cman_callback();
-		} else
-			break;
-	}
-
+	rv = cman_dispatch(ch, CMAN_DISPATCH_ALL);
 	if (rv == -1 && errno == EHOSTDOWN) {
 		log_error("cluster is down, exiting");
 		exit(1);
 	}
-
 	return 0;
 }
 



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

* [Cluster-devel] cluster/fence/fenced member_cman.c
@ 2006-12-14 19:56 teigland
  0 siblings, 0 replies; 4+ messages in thread
From: teigland @ 2006-12-14 19:56 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL50
Changes by:	teigland at sourceware.org	2006-12-14 19:56:23

Modified files:
	fence/fenced   : member_cman.c 

Log message:
	Switch from CMAN_DISPATCH_ONE loop to CMAN_DISPATCH_ALL to resolve
	delayed cman shutdown callbacks.
	bz 219385

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fenced/member_cman.c.diff?cvsroot=cluster&only_with_tag=RHEL50&r1=1.15&r2=1.15.4.1

--- cluster/fence/fenced/member_cman.c	2006/10/09 10:52:50	1.15
+++ cluster/fence/fenced/member_cman.c	2006/12/14 19:56:23	1.15.4.1
@@ -16,8 +16,6 @@
 #define BUFLEN		128
 
 static cman_handle_t	ch;
-static int		cman_cb;
-static int		cman_reason;
 static int		cman_quorate;
 static cman_node_t	cman_nodes[MAX_NODES];
 static int		cman_node_count;
@@ -90,53 +88,31 @@
 		log_error("cman_get_nodes error %d %d", rv, errno);
 }
 
-static void process_cman_callback(void)
-{
-	switch (cman_reason) {
-	case CMAN_REASON_STATECHANGE:
-		statechange();
-		break;
-	default:
-		break;
-	}
-}
-
 static void cman_callback(cman_handle_t h, void *private, int reason, int arg)
 {
-	cman_cb = 1;
-	cman_reason = reason;
-
-	if (reason == CMAN_REASON_TRY_SHUTDOWN) {
+	switch (reason) {
+	case CMAN_REASON_TRY_SHUTDOWN:
 		if (list_empty(&domains))
 			cman_replyto_shutdown(ch, 1);
 		else {
 			log_debug("no to cman shutdown");
 			cman_replyto_shutdown(ch, 0);
 		}
+		break;
+	case CMAN_REASON_STATECHANGE:
+		statechange();
+		break;
 	}
 }
 
 int process_member(void)
 {
 	int rv;
-
-	while (1) {
-		rv = cman_dispatch(ch, CMAN_DISPATCH_ONE);
-		if (rv < 0)
-			break;
-
-		if (cman_cb) {
-			cman_cb = 0;
-			process_cman_callback();
-		} else
-			break;
-	}
-
+	rv = cman_dispatch(ch, CMAN_DISPATCH_ALL);
 	if (rv == -1 && errno == EHOSTDOWN) {
 		log_error("cluster is down, exiting");
 		exit(1);
 	}
-
 	return 0;
 }
 



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

end of thread, other threads:[~2006-12-14 19:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-14 19:55 [Cluster-devel] cluster/fence/fenced member_cman.c teigland
  -- strict thread matches above, loose matches on Subject: below --
2006-12-14 19:56 teigland
2006-12-14 19:55 teigland
2006-07-28 18:41 teigland

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.