From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27324 invoked by alias); 20 Aug 2008 08:46:56 -0000 Received: (qmail 27318 invoked by alias); 20 Aug 2008 08:46:56 -0000 X-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_MX,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on bastion.fedora.phx.redhat.com X-Spam-Level: Subject: master - cman: Return quorum state in a STATECHANGE notification To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: e741c874e6bfbad5ace5fa2938080c35222a469d X-Git-Newrev: f1cd52dd57737623008f2e32b460cd7b426c51e0 From: Christine Caulfield Message-Id: <20080820084551.72B511202BA@lists.fedorahosted.org> Date: Wed, 20 Aug 2008 08:53:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2008-q3/txt/msg00287.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=f1cd52dd57737623008f2e32b460cd7b426c51e0 Commit: f1cd52dd57737623008f2e32b460cd7b426c51e0 Parent: e741c874e6bfbad5ace5fa2938080c35222a469d Author: Christine Caulfield AuthorDate: Wed Aug 20 09:45:04 2008 +0100 Committer: Christine Caulfield 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 --- 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)