]> git.proxmox.com Git - mirror_corosync.git/commitdiff
Force consensus timer to be at minimum 1.2 * token to prevent one group of
authorSteven Dake <sdake@redhat.com>
Sun, 6 Dec 2009 01:35:05 +0000 (01:35 +0000)
committerSteven Dake <sdake@redhat.com>
Sun, 6 Dec 2009 01:35:05 +0000 (01:35 +0000)
nodes from executing a token timeout in the COMMIT state while another node
executes a consensus timeout, showing to applications as a temporary network
partition.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2567 fd59a12c-fef9-0310-b244-a6a79926bd2f

exec/totemconfig.c
man/corosync.conf.5

index f5ed5160d0f859fb100147e23ddd6622a24f750f..de02c770677fe3a4cbaf09bb45255c4eec53e969 100644 (file)
@@ -71,7 +71,6 @@
 #define TOKEN_RETRANSMIT_TIMEOUT               (int)(TOKEN_TIMEOUT / (TOKEN_RETRANSMITS_BEFORE_LOSS_CONST + 0.2))
 #define TOKEN_HOLD_TIMEOUT                     (int)(TOKEN_RETRANSMIT_TIMEOUT * 0.8 - (1000/(int)HZ))
 #define JOIN_TIMEOUT                           50
-#define CONSENSUS_TIMEOUT                      800
 #define MERGE_TIMEOUT                          200
 #define DOWNCHECK_TIMEOUT                      1000
 #define FAIL_TO_RECV_CONST                     50
@@ -550,7 +549,7 @@ int totem_config_validate (
        }
 
        if (totem_config->consensus_timeout == 0) {
-               totem_config->consensus_timeout = CONSENSUS_TIMEOUT;
+               totem_config->consensus_timeout = (int)(float)(1.2 * totem_config->token_timeout);
        }
 
        if (totem_config->consensus_timeout < MINIMUM_TIMEOUT) {
@@ -560,6 +559,13 @@ int totem_config_validate (
                goto parse_error;
        }
 
+       if (totem_config->consensus_timeout <= 1.2 * totem_config->token_timeout) {
+               snprintf (local_error_reason, sizeof(local_error_reason),
+                       "The consensus timeout parameter (%d ms) must be atleast 1.2 * token (%d ms).",
+                       totem_config->consensus_timeout, (int) ((float)1.2 * totem_config->token_timeout));
+               goto parse_error;
+       }
+
        if (totem_config->merge_timeout == 0) {
                totem_config->merge_timeout = MERGE_TIMEOUT;
        }
index 850a284206d9508a4a65ee2e5f173f11c8c7c890..6abe5c4e76b1dd77bf68171f0d6e59bbf6c5b1d2 100644 (file)
@@ -325,9 +325,11 @@ The default is 0 milliseconds.
 .TP
 consensus
 This timeout specifies in milliseconds how long to wait for consensus to be
-achieved before starting a new round of membership configuration.
+achieved before starting a new round of membership configuration.  The minimum
+value for consensus must be 1.2 * token.  This value will be automatically
+calculated at 1.2 * token if the user doesn't specify a consensus value.
 
-The default is 800 milliseconds.
+The default is 1200 milliseconds.
 
 .TP
 merge