unsigned int set_aru;
- int old_ring_state_saved;
-
int old_ring_state_aru;
unsigned int old_ring_state_high_seq_received;
*/
static void old_ring_state_save (struct totemsrp_instance *instance)
{
- 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);
- }
+ 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_state_restore (struct totemsrp_instance *instance)
+static void old_ring_state_restore (struct totemsrp_instance *instance)
{
- if (instance->old_ring_state_saved) {
- memcpy (&instance->my_ring_id, &instance->my_old_ring_id,
- sizeof (struct memb_ring_id));
-
- instance->my_aru = instance->old_ring_state_aru;
- instance->my_high_seq_received = instance->old_ring_state_high_seq_received;
- log_printf (instance->totemsrp_log_level_debug,
- "Restoring instance->my_aru %x my high seq received %x\n",
- instance->my_aru, instance->my_high_seq_received);
- }
+ instance->my_aru = instance->old_ring_state_aru;
+ instance->my_high_seq_received = instance->old_ring_state_high_seq_received;
+ log_printf (instance->totemsrp_log_level_debug,
+ "Restoring instance->my_aru %x my high seq received %x\n",
+ instance->my_aru, instance->my_high_seq_received);
}
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_pause_timeout (struct totemsrp_instance *instance)
reset_pause_timeout (instance);
}
+static void memb_recovery_state_token_loss (struct totemsrp_instance *instance)
+{
+ old_ring_state_restore (instance);
+ memb_state_gather_enter (instance, 5);
+ instance->stats.recovery_token_lost++;
+}
+
static void timer_function_orf_token_timeout (void *data)
{
struct totemsrp_instance *instance = data;
case MEMB_STATE_RECOVERY:
log_printf (instance->totemsrp_log_level_debug,
"The token was lost in the RECOVERY state.\n");
- ring_state_restore (instance);
- memb_state_gather_enter (instance, 5);
- instance->stats.recovery_token_lost++;
+ memb_recovery_state_token_loss (instance);
break;
}
}
break;
}
message_item = (struct message_item *)cs_queue_item_get (mcast_queue);
- /* preincrement required by algo */
- if (instance->old_ring_state_saved &&
- (instance->memb_state == MEMB_STATE_GATHER ||
- instance->memb_state == MEMB_STATE_COMMIT)) {
-
- log_printf (instance->totemsrp_log_level_debug,
- "not multicasting at seqno is %d\n",
- token->seq);
- return (0);
- }
message_item->mcast->seq = ++token->seq;
message_item->mcast->this_seqno = instance->global_seqno++;
memb_join->ring_seq >= instance->my_ring_id.seq) {
- ring_state_restore (instance);
-
memb_join_process (instance, memb_join);
+ memb_recovery_state_token_loss (instance);
memb_state_gather_enter (instance, 14);
}
break;