Huh, typo :)

New patch included.

Regards,
  Honza

Steven Dake wrote:
> This patch is missing:
>                 instance->old_ring_state_saved = 1;
> in the if statement
> 
> After that is fixed, good for merge.
> 
> Reviewed-by: Steven Dake <[email protected]>
> 
> On 03/29/2011 02:55 AM, Jan Friesse wrote:
>> Backport of Corosync 0eabeee63eca7a4cc1d907607057ac668fafbcae
>>
>> The current code stores the current ring information every time a commit
>> token is generated.  This causes the old ring id used for comparison purposes
>> to increase if a token is lost in commit or recovery, resulting in failure of
>> totem.  This patch changes the behavior to only store the old ring id one
>> time when the commit token is received, and then further commit token ring
>> id saves are not done until OPERATIONAL is reached.
>>
>> Signed-off-by: Jan Friesse <[email protected]>
>> ---
>>  branches/whitetank/exec/totemsrp.c |   19 ++++++++++++-------
>>  1 files changed, 12 insertions(+), 7 deletions(-)
>>
>> diff --git a/branches/whitetank/exec/totemsrp.c 
>> b/branches/whitetank/exec/totemsrp.c
>> index 4d6ee9e..aa73471 100644
>> --- a/branches/whitetank/exec/totemsrp.c
>> +++ b/branches/whitetank/exec/totemsrp.c
>> @@ -477,6 +477,8 @@ struct totemsrp_instance {
>>  
>>      unsigned int set_aru;
>>  
>> +    int old_ring_state_saved;
>> +
>>      int old_ring_state_aru;
>>  
>>      unsigned int old_ring_state_high_seq_received;
>> @@ -1312,13 +1314,15 @@ static void cancel_merge_detect_timeout (struct 
>> totemsrp_instance *instance)
>>   */
>>  static void old_ring_state_save (struct totemsrp_instance *instance)
>>  {
>> -    memcpy (&instance->my_old_ring_id, &instance->my_ring_id,
>> -            sizeof (struct memb_ring_id));
>> -    instance->old_ring_state_aru = instance->my_aru;
>> -    instance->old_ring_state_high_seq_received = 
>> instance->my_high_seq_received;
>> -    log_printf (instance->totemsrp_log_level_debug,
>> -            "Saving state aru %x high seq received %x\n",
>> -            instance->my_aru, instance->my_high_seq_received);
>> +    if (instance->old_ring_state_saved == 0) {
>> +            memcpy (&instance->my_old_ring_id, &instance->my_ring_id,
>> +                    sizeof (struct memb_ring_id));
>> +            instance->old_ring_state_aru = instance->my_aru;
>> +            instance->old_ring_state_high_seq_received = 
>> instance->my_high_seq_received;
>> +            log_printf (instance->totemsrp_log_level_debug,
>> +                    "Saving state aru %x high seq received %x\n",
>> +                    instance->my_aru, instance->my_high_seq_received);
>> +    }
>>  }
>>  
>>  static void ring_save (struct totemsrp_instance *instance)
>> @@ -1348,6 +1352,7 @@ static void old_ring_state_reset (struct 
>> totemsrp_instance *instance)
>>  {
>>      log_printf (instance->totemsrp_log_level_debug,
>>              "Resetting old ring state\n");
>> +    instance->old_ring_state_saved = 0;
>>  }
>>  
>>  static void reset_token_timeout (struct totemsrp_instance *instance) {
> 

>From 7412d91029293f8a4938d1ebd0c6da2c86b0c2ea Mon Sep 17 00:00:00 2001
From: Jan Friesse <[email protected]>
Date: Tue, 29 Mar 2011 10:15:19 +0200
Subject: [PATCH 3/4] totemsrp: Only restore old ring id information one time

Backport of Corosync 0eabeee63eca7a4cc1d907607057ac668fafbcae

The current code stores the current ring information every time a commit
token is generated.  This causes the old ring id used for comparison purposes
to increase if a token is lost in commit or recovery, resulting in failure of
totem.  This patch changes the behavior to only store the old ring id one
time when the commit token is received, and then further commit token ring
id saves are not done until OPERATIONAL is reached.

Signed-off-by: Jan Friesse <[email protected]>
---
 branches/whitetank/exec/totemsrp.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/branches/whitetank/exec/totemsrp.c 
b/branches/whitetank/exec/totemsrp.c
index 4d6ee9e..88b4abc 100644
--- a/branches/whitetank/exec/totemsrp.c
+++ b/branches/whitetank/exec/totemsrp.c
@@ -477,6 +477,8 @@ struct totemsrp_instance {
 
        unsigned int set_aru;
 
+       int old_ring_state_saved;
+
        int old_ring_state_aru;
 
        unsigned int old_ring_state_high_seq_received;
@@ -1312,13 +1314,16 @@ static void cancel_merge_detect_timeout (struct 
totemsrp_instance *instance)
  */
 static void old_ring_state_save (struct totemsrp_instance *instance)
 {
-       memcpy (&instance->my_old_ring_id, &instance->my_ring_id,
-               sizeof (struct memb_ring_id));
-       instance->old_ring_state_aru = instance->my_aru;
-       instance->old_ring_state_high_seq_received = 
instance->my_high_seq_received;
-       log_printf (instance->totemsrp_log_level_debug,
-               "Saving state aru %x high seq received %x\n",
-               instance->my_aru, instance->my_high_seq_received);
+       if (instance->old_ring_state_saved == 0) {
+               instance->old_ring_state_saved = 1;
+               memcpy (&instance->my_old_ring_id, &instance->my_ring_id,
+                       sizeof (struct memb_ring_id));
+               instance->old_ring_state_aru = instance->my_aru;
+               instance->old_ring_state_high_seq_received = 
instance->my_high_seq_received;
+               log_printf (instance->totemsrp_log_level_debug,
+                       "Saving state aru %x high seq received %x\n",
+                       instance->my_aru, instance->my_high_seq_received);
+       }
 }
 
 static void ring_save (struct totemsrp_instance *instance)
@@ -1348,6 +1353,7 @@ static void old_ring_state_reset (struct 
totemsrp_instance *instance)
 {
        log_printf (instance->totemsrp_log_level_debug,
                "Resetting old ring state\n");
+       instance->old_ring_state_saved = 0;
 }
 
 static void reset_token_timeout (struct totemsrp_instance *instance) {
-- 
1.5.5.6

_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to