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

Christine Caulfield chrissie at fedoraproject.org
Wed Dec 16 13:08:58 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=c3fd533042a15a684206439e51a5377528e8b709
Commit:        c3fd533042a15a684206439e51a5377528e8b709
Parent:        31a310c603936867f651295358e31af6c2714f6a
Author:        Christine Caulfield <ccaulfie at redhat.com>
AuthorDate:    Wed Dec 16 13:07:11 2009 +0000
Committer:     Christine Caulfield <ccaulfie at redhat.com>
CommitterDate: Wed Dec 16 13:07:11 2009 +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

rhbzbz#544482

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 9a874a8..787f0bd 100644
--- a/cman/daemon/ais.c
+++ b/cman/daemon/ais.c
@@ -520,11 +520,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