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

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=2c84dad158099d33d5f68f0416fa9389ddd8a1b6
Commit:        2c84dad158099d33d5f68f0416fa9389ddd8a1b6
Parent:        58f17ffd05d7333ae45c6a3c21fc87e42bff85e5
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Wed Aug 20 09:51:32 2008 +0100
Committer:     Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Wed Aug 20 09:51:32 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 9abcccb..6728335 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -323,7 +323,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 1ae8b45..3771176 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:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-20 13:21 STABLE2 - 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).