cluster: RHEL55 - cman: Reduce consensus value

Lon Hohberger lon at fedoraproject.org
Wed Jul 28 23:03:51 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=bb581356afc53b8b1dba8594cae5ee8970f8ce58
Commit:        bb581356afc53b8b1dba8594cae5ee8970f8ce58
Parent:        9e4ac14c0c65116a05e8b6a7dfd5f7f8ce8f0742
Author:        Christine Caulfield <ccaulfie at redhat.com>
AuthorDate:    Tue Jul 27 09:06:18 2010 +0100
Committer:     Lon Hohberger <lhh at redhat.com>
CommitterDate: Wed Jul 28 19:02:08 2010 -0400

cman: Reduce consensus value

Make consensus 1.2*totem under normal circumstances or
0.2*totem for a two_node cluster

Resolves: rhbz#618639

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

diff --git a/cman/daemon/ais.c b/cman/daemon/ais.c
index 787f0bd..ab51b12 100644
--- a/cman/daemon/ais.c
+++ b/cman/daemon/ais.c
@@ -52,6 +52,7 @@ extern char *key_filename;
 extern unsigned int quorumdev_poll;
 extern unsigned int ccsd_poll_interval;
 extern unsigned int shutdown_timeout;
+extern int two_node;
 extern int init_config(struct objdb_iface_ver0 *objdb);
 
 struct totem_ip_address mcast_addr[MAX_INTERFACES];
@@ -515,21 +516,31 @@ static int comms_init_ais(struct objdb_iface_ver0 *objdb)
 							"20", strlen("20")+1);
 		}
 
-		/* Extend consensus & join timeouts per bz#214290 */
+		/* Extend join timeout per bz#214290 */
 		if (objdb_get_string(objdb, object_handle, "join", &value)) {
 			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)) {
-		        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);
-		}
+
+		/* bz#611391
+		 * consensus should be 1.2*token or for 0.2*token for two_node clusters
+		 */
+ 		if (objdb_get_string(objdb, object_handle, "consensus", &value)) {
+ 		        unsigned int token=0;
+			unsigned int consensus;
+ 			char calc_consensus[32];
+
+ 			objdb_get_int(objdb, object_handle, "token", &token);
+
+			if (two_node)
+				consensus = (float)token*0.2;
+			else
+				consensus = (float)token*1.2;
+
+			snprintf(calc_consensus, sizeof(calc_consensus), "%d", consensus);
+ 			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