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

Lon Hohberger lon at fedoraproject.org
Thu Jul 22 18:42:56 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=668d3c667349e93f1e52e0a2be5e22385b9a1b76
Commit:        668d3c667349e93f1e52e0a2be5e22385b9a1b76
Parent:        ea72ab5e568caa0dff9318df22f990463fb29e43
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 14:42:48 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 058cc87..604e400 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -1100,6 +1100,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)
@@ -1149,8 +1150,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