[Spread-cvs] cvs commit: spread/daemon Readme.txt membership.c protocol.c

jonathan at spread.org jonathan at spread.org
Sun Oct 3 01:21:11 EDT 2004


jonathan    04/10/03 01:21:11

  Modified:    daemon   Readme.txt membership.c protocol.c
  Log:
  Fix EVS bug where some AGREED messages could be delivered before the
  transitional signal on one daemon and after it on another. Now all
  RELIABLE and AGREED messages upto the first hole or SAFE are delivered
  before the signal. Bug report and patch by Ryan Caudy.
  
  Revision  Changes    Path
  1.65      +3 -0      spread/daemon/Readme.txt
  
  Index: Readme.txt
  ===================================================================
  RCS file: /storage/cvsroot/spread/daemon/Readme.txt,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- Readme.txt	3 Oct 2004 01:24:33 -0000	1.64
  +++ Readme.txt	3 Oct 2004 05:21:11 -0000	1.65
  @@ -98,6 +98,9 @@
   15) Fix Java spread connection problem where several threaded connections from same 
       process cause unexpected connection failures. Reported by Brian Moseley, 
       idea of fix by Ryan Caudy, patch by Jonathan Stanton.
  +16) Fix EVS bug where AGREED messages may be delivered before a transitional signal
  +    on some daemons and after it on others. Bug found and patch created by 
  +    Ryan Caudy.
   
   SOURCE INSTALL:
   ---------------
  
  
  
  1.7       +3 -0      spread/daemon/membership.c
  
  Index: membership.c
  ===================================================================
  RCS file: /storage/cvsroot/spread/daemon/membership.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- membership.c	2 Oct 2004 22:42:28 -0000	1.6
  +++ membership.c	3 Oct 2004 05:21:11 -0000	1.7
  @@ -1931,6 +1931,9 @@
   
   	Highest_seq = my_rg_info->highest_seq;
   	Aru	    = my_rg_info->aru;
  +        /* Note: this call to Discard_packets handles delivery of all the messages
  +         *       from the old membership with sequence numbers prior to the old Aru.
  +         */
   	Discard_packets();
   	
   	for( i=0; i < my_rg_info->num_holes; i++ )
  
  
  
  1.9       +39 -4     spread/daemon/protocol.c
  
  Index: protocol.c
  ===================================================================
  RCS file: /storage/cvsroot/spread/daemon/protocol.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- protocol.c	5 Mar 2004 00:32:46 -0000	1.8
  +++ protocol.c	3 Oct 2004 05:21:11 -0000	1.9
  @@ -1035,17 +1035,52 @@
   
   	if( Aru != Last_seq ) return;
   
  +        /* Deliver packets that must be delivered before the transitional signal.
  +         * Those up to the Aru for my old ring were delivered in Read_form2().
  +         * So, it remains to deliver all packets up to the first hole or the first
  +         * SAFE message. */
  +        Alarmp( SPLOG_INFO, PROTOCOL,
  +                "Discard_packets: delivering messages after old ring Aru before transitional\n" );
  +
  +        for( i = Last_discarded+1; i <= Highest_seq; i++ )
  +        {
  +            pack_entry = i & PACKET_MASK;
  +	    if( ! Packets[pack_entry].exist )
  +		Alarmp( SPLOG_FATAL, PROTOCOL, "Discard_packets: (EVS before transitional) packet %d not exist\n", i);
  +	    if( Packets[pack_entry].exist == 3 )
  +	    {
  +		Alarmp( SPLOG_INFO, PROTOCOL, "Discard_packets: Found first Hole in %d\n", i);
  +                break;
  +	    }
  +            if( Is_safe( Packets[pack_entry].head->type ) ) {
  +                Alarmp( SPLOG_INFO, PROTOCOL, "Discard_packets: Found first SAFE message in %d", i);
  +                break;
  +            }
  +            /* should deliver packet or dispose the body if it was delivered already */
  +            if( Packets[pack_entry].exist == 1 ){
  +                Deliver_packet( pack_entry, 0 );
  +            } else {
  +                dispose( Packets[pack_entry].body );
  +            }
  +            /* dispose packet header in any case */
  +            dispose( Packets[pack_entry].head );
  +            Alarmp( SPLOG_INFO, PROTOCOL, "Discard_packets: delivering %d in EVS\n",i);
  +	    Packets[pack_entry].exist = 0;
  +            Last_discarded = i;
  +        }
  +
   	/* calculate and deliver transitional membership */
  +        Alarmp( SPLOG_INFO, PROTOCOL, "Discard_packets: Delivering transitional membership\n" );
   	Memb_transitional();
   	Sess_deliver_trans_memb( Trans_membership, Memb_trans_id() );
   
  -	/* deliver all packets */
  +	/* deliver all remaining packets for EVS */
   	found_hole = 0;
   	for( i = Last_discarded+1; i <= Highest_seq; i++ )
   	{
   	    pack_entry = i & PACKET_MASK;
   	    if( ! Packets[pack_entry].exist )
  -		Alarm( EXIT, "Discard_packets: packet %d not exist\n",i);
  +		Alarm( EXIT, "Discard_packets: (EVS after transitional) packet %d not exist\n", i);
   	    if( Packets[pack_entry].exist == 3 )
   	    {
   		/* 
  @@ -1132,7 +1167,7 @@
   	{
   	    pack_entry = i & PACKET_MASK;
   	    if( ! Packets[pack_entry].exist )
  -		Alarm( EXIT, "Discard_packets: packet %d not exist\n",i);
  +		Alarm( EXIT, "Discard_packets: (NOT EVS) packet %d not exist\n",i);
   
   	    /* should deliver packet or dispose the body if it was delivered already */
   	    if( Packets[pack_entry].exist == 1 ) Deliver_packet( pack_entry, 0 );
  @@ -1141,7 +1176,7 @@
   	    dispose( Packets[pack_entry].head );
   	    Packets[pack_entry].exist = 0;
   	}
  -	Alarm( PROTOCOL, "Discard_packets: packets %d-%d where discarded\n",
  +	Alarm( PROTOCOL, "Discard_packets: packets %d-%d were discarded\n",
   			Last_discarded+1, Aru );
   
   	Last_discarded = Aru;
  
  
  




More information about the Spread-cvs mailing list