public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* master - cman: Return quorum state in a STATECHANGE notification
@ 2008-08-20  8:53 Christine Caulfield
  0 siblings, 0 replies; only message in thread
From: Christine Caulfield @ 2008-08-20  8:53 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=f1cd52dd57737623008f2e32b460cd7b426c51e0
Commit:        f1cd52dd57737623008f2e32b460cd7b426c51e0
Parent:        e741c874e6bfbad5ace5fa2938080c35222a469d
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Wed Aug 20 09:45:04 2008 +0100
Committer:     Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Wed Aug 20 09:45:04 2008 +0100

cman: Return quorum state in a STATECHANGE notification

This should remove a potential race condition where quorum changes
after the message is received.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
 cman/daemon/commands.c |    2 +-
 cman/lib/libcman.h     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index f2236cb..1172f5d 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -361,7 +361,7 @@ static void recalculate_quorum(int allow_decrease, int by_current_nodes)
 
 	quorum = calculate_quorum(allow_decrease, by_current_nodes?cluster_members:0, &total_votes);
 	set_quorate(total_votes);
-	notify_listeners(NULL, EVENT_REASON_STATECHANGE, 0);
+	notify_listeners(NULL, EVENT_REASON_STATECHANGE, cluster_is_quorate);
 }
 
 /* Copy internal node format to userland format */
diff --git a/cman/lib/libcman.h b/cman/lib/libcman.h
index 82049a7..91c24dc 100644
--- a/cman/lib/libcman.h
+++ b/cman/lib/libcman.h
@@ -39,7 +39,7 @@ typedef void *cman_handle_t;
  *
  * The 'arg' parameter varies depending on the callback type.
  * for PORTCLOSED/PORTOPENED  arg == the port opened/closed
- * for STATECHANGE            arg should be ignored
+ * for STATECHANGE            arg is quorum state (1=quorate, 0=not)
  * for TRY_SHUTDOWN           arg == 1 for ANYWAY, otherwise 0 (ie if arg == 1 
  * 			      then cman WILL shutdown regardless
  *                            of your response, think of this as advance warning)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-08-20  8:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-20  8:53 master - cman: Return quorum state in a STATECHANGE notification Christine Caulfield

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 read-only IMAP folder(s) and NNTP newsgroup(s).