Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > d236c5da97a239a1b6991cfba2865b66 > files > 15

cman-2.0.115-68.el5_6.1.src.rpm

commit c3fd533042a15a684206439e51a5377528e8b709
Author: Christine Caulfield <ccaulfie@redhat.com>
Date:   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@redhat.com>

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) {