Переглянути джерело

Add scalability to 128 nodes by adding new parameter to protocol which is
a random timeout bounded by a configuration parameter when sending join
messages.


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

Steven Dake 19 роки тому
батько
коміт
59a7b2e043
4 змінених файлів з 25 додано та 2 видалено
  1. 2 0
      exec/totem.h
  2. 1 0
      exec/totemconfig.c
  3. 10 2
      exec/totemsrp.c
  4. 12 0
      man/openais.conf.5

+ 2 - 0
exec/totem.h

@@ -111,6 +111,8 @@ struct totem_config {
 
 	unsigned int join_timeout;
 
+	unsigned int send_join_timeout;
+
 	unsigned int consensus_timeout;
 
 	unsigned int merge_timeout;

+ 1 - 0
exec/totemconfig.c

@@ -190,6 +190,7 @@ extern int totem_config_read (
 		objdb_get_int (objdb,object_totem_handle, "token_retransmits_before_loss_const", &totem_config->token_retransmits_before_loss_const);
 
 		objdb_get_int (objdb,object_totem_handle, "join", &totem_config->join_timeout);
+		objdb_get_int (objdb,object_totem_handle, "send_join", &totem_config->send_join_timeout);
 
 		objdb_get_int (objdb,object_totem_handle, "consensus", &totem_config->consensus_timeout);
 

+ 10 - 2
exec/totemsrp.c

@@ -716,8 +716,11 @@ int totemsrp_initialize (
 		"token hold (%d ms) retransmits before loss (%d retrans)\n",
 		totem_config->token_hold_timeout, totem_config->token_retransmits_before_loss_const);
 	log_printf (instance->totemsrp_log_level_notice,
-		"join (%d ms) consensus (%d ms) merge (%d ms)\n",
-		totem_config->join_timeout, totem_config->consensus_timeout,
+		"join (%d ms) send_join (%d ms) consensus (%d ms) merge (%d ms)\n",
+		totem_config->join_timeout,
+		totem_config->send_join_timeout,
+		totem_config->consensus_timeout,
+
 		totem_config->merge_timeout);
 	log_printf (instance->totemsrp_log_level_notice,
 		"downcheck (%d ms) fail to recv const (%d msgs)\n",
@@ -2711,6 +2714,7 @@ static void memb_join_message_send (struct totemsrp_instance *instance)
 	memb_join.header.nodeid = instance->my_id.addr[0].nodeid;
 	assert (memb_join.header.nodeid);
 
+
 	assert (srp_addr_equal (&instance->my_proc_list[0], &instance->my_proc_list[1]) == 0);
 	memb_join.ring_seq = instance->my_ring_id.seq;
 	memb_join.proc_list_entries = instance->my_proc_list_entries;
@@ -2726,6 +2730,10 @@ static void memb_join_message_send (struct totemsrp_instance *instance)
 	iovec[2].iov_len = instance->my_failed_list_entries *
 		sizeof (struct srp_addr);
 
+	if (instance->totem_config->send_join_timeout) {
+		usleep (random() % (instance->totem_config->send_join_timeout * 1000));
+	}
+
 	totemrrp_mcast_flush_send (
 		instance->totemrrp_handle,
 		iovec,

+ 12 - 0
man/openais.conf.5

@@ -274,6 +274,18 @@ the membership protocol.
 
 The default is 100 milliseconds.
 
+.TP
+send_join
+This timeout specifies in milliseconds an upper range between 0 and send_join
+to wait before sending a join message.  For configurations with less then
+32 nodes, this parameter is not necessary.  For larger rings, this parameter
+is necessary to ensure the NIC is not overflowed with join messages on
+formation of a new ring.  A reasonable value for large rings (128 nodes) would
+be 80msec.  Other timer values must also change if this value is changed.  Seek
+advice from the openais mailing list if trying to run larger configurations.
+
+The default is 0 milliseconds.
+
 .TP
 consensus
 This timeout specifies in milliseconds how long to wait for consensus to be