cluster: RHEL53 - cman: Make consensus 2*token timeout

Christine Caulfield chrissie at fedoraproject.org
Tue Mar 9 13:10:34 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=5910132e5c0b149c79bf5e3c66aee7444bdfeded
Commit:        5910132e5c0b149c79bf5e3c66aee7444bdfeded
Parent:        1df984f69577cf57d3b1f23cdd74434cfe84d7b1
Author:        Christine Caulfield <ccaulfie at redhat.com>
AuthorDate:    Tue Mar 9 13:09:05 2010 +0000
Committer:     Christine Caulfield <ccaulfie at redhat.com>
CommitterDate: Tue Mar 9 13:09:05 2010 +0000

cman: Make consensus 2*token timeout

    If consensus is not specified in cluster.conf then make it twice
    the token value. For full details of why, see the Bugzilla bz#544482

    RHEL 5.3 bz#567538

Signed-off-by: Christine Caulfield <ccaulfie at redhat.com>
---
 cman/daemon/ais.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/cman/daemon/ais.c b/cman/daemon/ais.c
index dc1d5af..fe237f6 100644
--- a/cman/daemon/ais.c
+++ b/cman/daemon/ais.c
@@ -502,11 +502,16 @@ static int comms_init_ais(struct objdb_iface_ver0 *objdb)
 			global_objdb->object_key_create(object_handle, "join", strlen("join"),
 							"60", strlen("60")+1);
 		}
+		/* consensus should be 2*token, see bz#544482*/
 		if (objdb_get_string(objdb, object_handle, "consensus", &value)) {
-			global_objdb->object_key_create(object_handle, "consensus", strlen("consensus"),
-							"4800", strlen("4800")+1);
-		}
+		        unsigned int token=0;
+			char calc_consensus[32];
 
+			objdb_get_int(objdb, object_handle, "token", &token);
+			sprintf(calc_consensus, "%d", token*2);
+			objdb->object_key_create(object_handle, "consensus", strlen("consensus"),
+						 calc_consensus, strlen(calc_consensus)+1);
+		}
 
 		/* Set RRP mode appropriately */
 		if (num_interfaces > 1) {


More information about the cluster-commits mailing list