[Spread-cvs] commit: r357 - in trunk: daemon docs

jonathan at spread.org jonathan at spread.org
Mon Nov 13 18:13:29 EST 2006


Author: jonathan
Date: 2006-11-13 18:13:29 -0500 (Mon, 13 Nov 2006)
New Revision: 357

Modified:
   trunk/daemon/Changelog
   trunk/daemon/membership.c
   trunk/daemon/prot_body.h
   trunk/daemon/protocol.c
   trunk/daemon/spread_params.h
   trunk/docs/sample.spread.conf
Log:
Patch to trigger a membership change if the token continues
to rotate too many times during EVS state (something that should not occur).
Original patch by John Schultz.



Modified: trunk/daemon/Changelog
===================================================================
--- trunk/daemon/Changelog	2006-11-13 21:23:58 UTC (rev 356)
+++ trunk/daemon/Changelog	2006-11-13 23:13:29 UTC (rev 357)
@@ -1,3 +1,12 @@
+Tue Sep 12 18:06:27 2006  Jonathan Stanton  <jonathan at cnds.jhu.edu>
+
+	* protocol.c, membership.c, prot_body.h, spread_params.h 
+	(Prot_handle_token,Read_form2): If token rotates too many
+	times during EVS state, trigger a membership change to 
+	recover. This works-around a rare case of the daemon getting 
+	stuck in EVS state for an unknown reason. 
+	Original patch by John Schultz.
+
 Sun Jun  4 01:01:51 2006  Jonathan Stanton  <jonathan at cnds.jhu.edu>
 
 	* Makefile.in (SHARED_STDUTIL): Change libspread.so target

Modified: trunk/daemon/membership.c
===================================================================
--- trunk/daemon/membership.c	2006-11-13 21:23:58 UTC (rev 356)
+++ trunk/daemon/membership.c	2006-11-13 23:13:29 UTC (rev 357)
@@ -2005,6 +2005,8 @@
 	{
 		Net_send_token( &send_scat );
 		Net_send_token( &send_scat );
+		Token_rounds = 0;
+
 	}else{
 		/* build first regular token */
 		send_scat.num_elements = 1;
@@ -2016,6 +2018,7 @@
 		form_token->rtr_len = 0;
 
 		Net_send_token( &send_scat );
+		Token_rounds = 1;
 	}
 	Token_alive = 1;
 	E_queue( Memb_token_loss, 0, NULL, Token_timeout );

Modified: trunk/daemon/prot_body.h
===================================================================
--- trunk/daemon/prot_body.h	2006-11-13 21:23:58 UTC (rev 356)
+++ trunk/daemon/prot_body.h	2006-11-13 23:13:29 UTC (rev 357)
@@ -73,6 +73,7 @@
 ext	int32		Last_discarded;
 ext	int32		Last_delivered;
 ext	int32		Last_seq;
+ext	int32		Token_rounds;
 ext	token_header	*Last_token;
 
 ext	int		Transitional;

Modified: trunk/daemon/protocol.c
===================================================================
--- trunk/daemon/protocol.c	2006-11-13 21:23:58 UTC (rev 356)
+++ trunk/daemon/protocol.c	2006-11-13 23:13:29 UTC (rev 357)
@@ -621,6 +621,8 @@
 		}
 	}
 
+	Token_rounds++;
+
 	if( Conf_leader( Memb_active_ptr() ) == My.id ) 
 		E_queue( Prot_token_hurry, 0, NULL, Hurry_timeout );
 
@@ -647,9 +649,34 @@
 	Deliver_agreed_packets();
 	Deliver_reliable_packets( Highest_seq-num_sent+1, num_sent );
 
+	if( Memb_state() == EVS && Token_rounds > MAX_EVS_ROUNDS ) 
+	{
+		Alarmp( SPLOG_ERROR, PRINT, "Prot_handle_token: BUG WORKAROUND: Too many rounds in EVS state; swallowing token; state:\n" );
+		Alarmp( SPLOG_ERROR, PRINT, "\tAru:              %d\n",   Aru );
+		Alarmp( SPLOG_ERROR, PRINT, "\tMy_aru:           %d\n",   My_aru );
+		Alarmp( SPLOG_ERROR, PRINT, "\tHighest_seq:      %d\n",   Highest_seq );
+		Alarmp( SPLOG_ERROR, PRINT, "\tHighest_fifo_seq: %d\n",   Highest_fifo_seq );
+		Alarmp( SPLOG_ERROR, PRINT, "\tLast_discarded:   %d\n",   Last_discarded );
+		Alarmp( SPLOG_ERROR, PRINT, "\tLast_delivered:   %d\n",   Last_delivered );
+		Alarmp( SPLOG_ERROR, PRINT, "\tLast_seq:         %d\n",   Last_seq );
+		Alarmp( SPLOG_ERROR, PRINT, "\tToken_rounds:     %d\n",   Token_rounds );
+		Alarmp( SPLOG_ERROR, PRINT, "Last Token:\n" );
+		Alarmp( SPLOG_ERROR, PRINT, "\ttype:             0x%x\n", Last_token->type );
+		Alarmp( SPLOG_ERROR, PRINT, "\ttransmiter_id:    %d\n",   Last_token->transmiter_id );
+		Alarmp( SPLOG_ERROR, PRINT, "\tseq:              %d\n",   Last_token->seq );
+		Alarmp( SPLOG_ERROR, PRINT, "\tproc_id:          %d\n",   Last_token->proc_id );
+		Alarmp( SPLOG_ERROR, PRINT, "\taru:              %d\n",   Last_token->aru );
+		Alarmp( SPLOG_ERROR, PRINT, "\taru_last_id:      %d\n",   Last_token->aru_last_id );
+		Alarmp( SPLOG_ERROR, PRINT, "\tflow_control:     %d\n",   Last_token->flow_control );
+		Alarmp( SPLOG_ERROR, PRINT, "\trtr_len:          %d\n",   Last_token->rtr_len );
+		Alarmp( SPLOG_ERROR, PRINT, "\tconf_hash:        %d\n",   Last_token->conf_hash );
+
+		Memb_token_loss();
+	}
+
 	GlobalStatus.highest_seq = Highest_seq;
 	GlobalStatus.aru = Aru;
-	GlobalStatus.token_rounds++;
+	GlobalStatus.token_rounds = Token_rounds;
 }
 
 /* Basic algorithm:

Modified: trunk/daemon/spread_params.h
===================================================================
--- trunk/daemon/spread_params.h	2006-11-13 21:23:58 UTC (rev 356)
+++ trunk/daemon/spread_params.h	2006-11-13 23:13:29 UTC (rev 357)
@@ -67,6 +67,8 @@
 
 #define		MAX_SEQ_GAP		1600	/* used in flow control to limit difference between highest_seq and aru */
 
+#define		MAX_EVS_ROUNDS		500 	/* used in EVS state to limit total # of rounds to complete EVS */
+
 #define		WATER_MARK		500	/* used to limit incoming user messages */
 
 #define		MAX_PRIVATE_NAME	 10     /* not including the null, look for it if changed */

Modified: trunk/docs/sample.spread.conf
===================================================================
--- trunk/docs/sample.spread.conf	2006-11-13 21:23:58 UTC (rev 356)
+++ trunk/docs/sample.spread.conf	2006-11-13 23:13:29 UTC (rev 357)
@@ -47,7 +47,7 @@
 #
 # The default level used if nothing is set is INFO.
 	
-#EventPriority = { INFO }
+#EventPriority =  INFO
 
 #Set whether to log to a file as opposed to stdout/stderr and what 
 # file to log to.




More information about the Spread-cvs mailing list