cluster: RHEL6 - cman: Recalculate quorum on quorum device vote changes

Lon Hohberger lon at fedoraproject.org
Thu Jul 22 20:33:46 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=657368d7d68eae52db155828e2087bdea51a4417
Commit:        657368d7d68eae52db155828e2087bdea51a4417
Parent:        6314b03d2657cae368787b9269af2fdcda08f871
Author:        Lon Hohberger <lhh at redhat.com>
AuthorDate:    Wed Jul 21 08:58:52 2010 -0400
Committer:     Lon Hohberger <lhh at redhat.com>
CommitterDate: Thu Jul 22 16:33:26 2010 -0400

cman: Recalculate quorum on quorum device vote changes

If the quorum device was a functioning member and we
reconfigure its votes, recalculate quorum.

Resolves: rhbz#606989

Signed-off-by: Lon Hohberger <lhh at redhat.com>
---
 cman/daemon/commands.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index 2f62616..c223a81 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -1099,6 +1099,7 @@ static int do_cmd_try_shutdown(struct connection *con, char *cmdbuf)
 static int do_cmd_register_quorum_device(char *cmdbuf, int *retlen)
 {
 	int votes;
+	int oldvotes;
 	char *name = cmdbuf+sizeof(int);
 
 	if (!ais_running)
@@ -1148,8 +1149,15 @@ static int do_cmd_register_quorum_device(char *cmdbuf, int *retlen)
 	}
 
 	/* Update votes even if it existed before */
+	oldvotes = quorum_device->votes;
         quorum_device->votes = votes;
 
+	/* If it is a member and votes decreased, recalculate quorum */
+	if (quorum_device->state == NODESTATE_MEMBER &&
+	    oldvotes != votes) {
+		recalculate_quorum(1, 0);
+	}
+
         return 0;
 }
 


More information about the cluster-commits mailing list