[PATCH 4/4] Add token_coef option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Token coefficient is used only when nodelist is specified and contains
at least 3 nodes. If so, real token timeout is then computed as
token + (number_of_nodes - 2) * token_coef. This allows cluster to
scale without manually changing token timeout every time new
node is added. This value can be set to 0 resulting in effective
removal of this feature.

Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
 exec/coroparse.c    |    1 +
 exec/totemconfig.c  |    8 ++++++++
 man/corosync.conf.5 |   12 ++++++++++++
 3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/exec/coroparse.c b/exec/coroparse.c
index 425e5d6..2b61d94 100644
--- a/exec/coroparse.c
+++ b/exec/coroparse.c
@@ -541,6 +541,7 @@ static int main_config_parser_cb(const char *path,
 			    (strcmp(path, "totem.nodeid") == 0) ||
 			    (strcmp(path, "totem.threads") == 0) ||
 			    (strcmp(path, "totem.token") == 0) ||
+			    (strcmp(path, "totem.token_coef") == 0) ||
 			    (strcmp(path, "totem.token_retransmit") == 0) ||
 			    (strcmp(path, "totem.hold") == 0) ||
 			    (strcmp(path, "totem.token_retransmits_before_loss_const") == 0) ||
diff --git a/exec/totemconfig.c b/exec/totemconfig.c
index 228f162..ed3d6bd 100644
--- a/exec/totemconfig.c
+++ b/exec/totemconfig.c
@@ -62,6 +62,7 @@
 
 #define TOKEN_RETRANSMITS_BEFORE_LOSS_CONST	4
 #define TOKEN_TIMEOUT				1000
+#define TOKEN_COEFFICIENT			650
 #define JOIN_TIMEOUT				50
 #define MERGE_TIMEOUT				200
 #define DOWNCHECK_TIMEOUT			1000
@@ -157,12 +158,19 @@ static void totem_volatile_config_set_value (struct totem_config *totem_config,
  */
 static void totem_volatile_config_read (struct totem_config *totem_config, const char *deleted_key)
 {
+	uint32_t u32;
 
 	totem_volatile_config_set_value(totem_config, "totem.token_retransmits_before_loss_const", deleted_key,
 	    TOKEN_RETRANSMITS_BEFORE_LOSS_CONST, 0);
 
 	totem_volatile_config_set_value(totem_config, "totem.token", deleted_key, TOKEN_TIMEOUT, 0);
 
+	if (totem_config->interface_count > 0 && totem_config->interfaces[0].member_count > 2) {
+		u32 = TOKEN_COEFFICIENT;
+		icmap_get_uint32("totem.token_coef", &u32);
+		totem_config->token_timeout += (totem_config->interfaces[0].member_count - 2) * u32;
+	}
+
 	totem_volatile_config_set_value(totem_config, "totem.max_network_delay", deleted_key, MAX_NETWORK_DELAY, 0);
 
 	totem_volatile_config_set_value(totem_config, "totem.window_size", deleted_key, WINDOW_SIZE, 0);
diff --git a/man/corosync.conf.5 b/man/corosync.conf.5
index 5d16152..55d1a82 100644
--- a/man/corosync.conf.5
+++ b/man/corosync.conf.5
@@ -300,6 +300,18 @@ milliseconds in addition to this timeout.
 The default is 1000 milliseconds.
 
 .TP
+token_coef
+This value is used only when
+.B nodelist
+section is specified and contains at least 3 nodes. If so, real token timeout
+is then computed as token + (number_of_nodes - 2) * token_coef. This allows
+cluster to scale without manually changing token timeout every time new
+node is added. This value can be set to 0 resulting in effective removal of
+this feature.
+
+The default is 650 milliseconds.
+
+.TP
 token_retransmit
 This timeout specifies in milliseconds after how long before receiving a token
 the token is retransmitted.  This will be automatically calculated if token
-- 
1.7.1

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss




[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux