public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Christine Caulfield <chrissie@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: master - cman: Return quorum state in a STATECHANGE notification
Date: Wed, 20 Aug 2008 08:53:00 -0000	[thread overview]
Message-ID: <20080820084551.72B511202BA@lists.fedorahosted.org> (raw)

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)


                 reply	other threads:[~2008-08-20  8:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080820084551.72B511202BA@lists.fedorahosted.org \
    --to=chrissie@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).