|
@@ -48,6 +48,7 @@
|
|
|
* usage on 1.6ghz xeon from 35% to less then .1 % as measured by top
|
|
* usage on 1.6ghz xeon from 35% to less then .1 % as measured by top
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
+#include <alloca.h>
|
|
|
#include <assert.h>
|
|
#include <assert.h>
|
|
|
#include <sys/mman.h>
|
|
#include <sys/mman.h>
|
|
|
#include <sys/types.h>
|
|
#include <sys/types.h>
|
|
@@ -88,6 +89,7 @@
|
|
|
#define RECEIVED_MESSAGE_QUEUE_SIZE_MAX 500 /* allow 500 messages to be queued */
|
|
#define RECEIVED_MESSAGE_QUEUE_SIZE_MAX 500 /* allow 500 messages to be queued */
|
|
|
#define MAXIOVS 5
|
|
#define MAXIOVS 5
|
|
|
#define RETRANSMIT_ENTRIES_MAX 30
|
|
#define RETRANSMIT_ENTRIES_MAX 30
|
|
|
|
|
+#define TOKEN_SIZE_MAX 64000 /* bytes */
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
* Rollover handling:
|
|
* Rollover handling:
|
|
@@ -542,7 +544,7 @@ static int message_handler_token_hold_cancel (
|
|
|
static void memb_ring_id_create_or_load (struct totemsrp_instance *, struct memb_ring_id *);
|
|
static void memb_ring_id_create_or_load (struct totemsrp_instance *, struct memb_ring_id *);
|
|
|
|
|
|
|
|
static void token_callbacks_execute (struct totemsrp_instance *instance, enum totem_callback_token_type type);
|
|
static void token_callbacks_execute (struct totemsrp_instance *instance, enum totem_callback_token_type type);
|
|
|
-static void memb_state_gather_enter (struct totemsrp_instance *instance);
|
|
|
|
|
|
|
+static void memb_state_gather_enter (struct totemsrp_instance *instance, unsigned int gather_from);
|
|
|
static void messages_deliver_to_app (struct totemsrp_instance *instance, int skip, unsigned int end_point);
|
|
static void messages_deliver_to_app (struct totemsrp_instance *instance, int skip, unsigned int end_point);
|
|
|
static int orf_token_mcast (struct totemsrp_instance *instance, struct orf_token *oken,
|
|
static int orf_token_mcast (struct totemsrp_instance *instance, struct orf_token *oken,
|
|
|
int fcc_mcasts_allowed);
|
|
int fcc_mcasts_allowed);
|
|
@@ -615,7 +617,7 @@ void totemsrp_instance_initialize (struct totemsrp_instance *instance)
|
|
|
|
|
|
|
|
instance->my_commit_token_seq = SEQNO_START_TOKEN - 1;
|
|
instance->my_commit_token_seq = SEQNO_START_TOKEN - 1;
|
|
|
|
|
|
|
|
- instance->orf_token_retransmit = malloc (15000);
|
|
|
|
|
|
|
+ instance->orf_token_retransmit = malloc (TOKEN_SIZE_MAX);
|
|
|
|
|
|
|
|
instance->memb_state = MEMB_STATE_OPERATIONAL;
|
|
instance->memb_state = MEMB_STATE_OPERATIONAL;
|
|
|
|
|
|
|
@@ -1335,7 +1337,7 @@ static void memb_state_consensus_timeout_expired (
|
|
|
|
|
|
|
|
memb_set_merge (no_consensus_list, no_consensus_list_entries,
|
|
memb_set_merge (no_consensus_list, no_consensus_list_entries,
|
|
|
instance->my_failed_list, &instance->my_failed_list_entries);
|
|
instance->my_failed_list, &instance->my_failed_list_entries);
|
|
|
- memb_state_gather_enter (instance);
|
|
|
|
|
|
|
+ memb_state_gather_enter (instance, 0);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1350,26 +1352,32 @@ static void timer_function_orf_token_timeout (void *data)
|
|
|
{
|
|
{
|
|
|
struct totemsrp_instance *instance = (struct totemsrp_instance *)data;
|
|
struct totemsrp_instance *instance = (struct totemsrp_instance *)data;
|
|
|
|
|
|
|
|
- log_printf (instance->totemsrp_log_level_notice,
|
|
|
|
|
- "The token was lost in state %d from timer %p\n", instance->memb_state, data);
|
|
|
|
|
switch (instance->memb_state) {
|
|
switch (instance->memb_state) {
|
|
|
case MEMB_STATE_OPERATIONAL:
|
|
case MEMB_STATE_OPERATIONAL:
|
|
|
|
|
+ log_printf (instance->totemsrp_log_level_notice,
|
|
|
|
|
+ "The token was lost in the OPERATIONAL state.\n");
|
|
|
totemrrp_iface_check (instance->totemrrp_handle);
|
|
totemrrp_iface_check (instance->totemrrp_handle);
|
|
|
- memb_state_gather_enter (instance);
|
|
|
|
|
|
|
+ memb_state_gather_enter (instance, 1);
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
case MEMB_STATE_GATHER:
|
|
case MEMB_STATE_GATHER:
|
|
|
|
|
+ log_printf (instance->totemsrp_log_level_notice,
|
|
|
|
|
+ "The consensus timeout expired.\n");
|
|
|
memb_state_consensus_timeout_expired (instance);
|
|
memb_state_consensus_timeout_expired (instance);
|
|
|
- memb_state_gather_enter (instance);
|
|
|
|
|
|
|
+ memb_state_gather_enter (instance, 2);
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
case MEMB_STATE_COMMIT:
|
|
case MEMB_STATE_COMMIT:
|
|
|
- memb_state_gather_enter (instance);
|
|
|
|
|
|
|
+ log_printf (instance->totemsrp_log_level_notice,
|
|
|
|
|
+ "The token was lost in the COMMIT state.\n");
|
|
|
|
|
+ memb_state_gather_enter (instance, 3);
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
case MEMB_STATE_RECOVERY:
|
|
case MEMB_STATE_RECOVERY:
|
|
|
|
|
+ log_printf (instance->totemsrp_log_level_notice,
|
|
|
|
|
+ "The token was lost in the RECOVERY state.\n");
|
|
|
ring_state_restore (instance);
|
|
ring_state_restore (instance);
|
|
|
- memb_state_gather_enter (instance);
|
|
|
|
|
|
|
+ memb_state_gather_enter (instance, 4);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1445,12 +1453,12 @@ static void deliver_messages_from_recovery_to_regular (struct totemsrp_instance
|
|
|
* Convert recovery message into regular message
|
|
* Convert recovery message into regular message
|
|
|
*/
|
|
*/
|
|
|
if (recovery_message_item->iov_len > 1) {
|
|
if (recovery_message_item->iov_len > 1) {
|
|
|
- mcast = recovery_message_item->iovec[1].iov_base;
|
|
|
|
|
|
|
+ mcast = (struct mcast *)recovery_message_item->iovec[1].iov_base;
|
|
|
memcpy (®ular_message_item.iovec[0],
|
|
memcpy (®ular_message_item.iovec[0],
|
|
|
&recovery_message_item->iovec[1],
|
|
&recovery_message_item->iovec[1],
|
|
|
sizeof (struct iovec) * recovery_message_item->iov_len);
|
|
sizeof (struct iovec) * recovery_message_item->iov_len);
|
|
|
} else {
|
|
} else {
|
|
|
- mcast = recovery_message_item->iovec[0].iov_base;
|
|
|
|
|
|
|
+ mcast = (struct mcast *)recovery_message_item->iovec[0].iov_base;
|
|
|
if (mcast->header.encapsulated == 1) {
|
|
if (mcast->header.encapsulated == 1) {
|
|
|
/*
|
|
/*
|
|
|
* Message is a recovery message encapsulated
|
|
* Message is a recovery message encapsulated
|
|
@@ -1461,7 +1469,7 @@ static void deliver_messages_from_recovery_to_regular (struct totemsrp_instance
|
|
|
regular_message_item.iovec[0].iov_len =
|
|
regular_message_item.iovec[0].iov_len =
|
|
|
recovery_message_item->iovec[0].iov_len - sizeof (struct mcast);
|
|
recovery_message_item->iovec[0].iov_len - sizeof (struct mcast);
|
|
|
regular_message_item.iov_len = 1;
|
|
regular_message_item.iov_len = 1;
|
|
|
- mcast = regular_message_item.iovec[0].iov_base;
|
|
|
|
|
|
|
+ mcast = (struct mcast *)regular_message_item.iovec[0].iov_base;
|
|
|
} else {
|
|
} else {
|
|
|
continue; /* TODO this case shouldn't happen */
|
|
continue; /* TODO this case shouldn't happen */
|
|
|
/*
|
|
/*
|
|
@@ -1606,7 +1614,9 @@ static void memb_state_operational_enter (struct totemsrp_instance *instance)
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void memb_state_gather_enter (struct totemsrp_instance *instance)
|
|
|
|
|
|
|
+static void memb_state_gather_enter (
|
|
|
|
|
+ struct totemsrp_instance *instance,
|
|
|
|
|
+ unsigned int gather_from)
|
|
|
{
|
|
{
|
|
|
instance->my_commit_token_seq = SEQNO_START_TOKEN - 1;
|
|
instance->my_commit_token_seq = SEQNO_START_TOKEN - 1;
|
|
|
|
|
|
|
@@ -1653,7 +1663,7 @@ static void memb_state_gather_enter (struct totemsrp_instance *instance)
|
|
|
memb_consensus_set (instance, &instance->my_id);
|
|
memb_consensus_set (instance, &instance->my_id);
|
|
|
|
|
|
|
|
log_printf (instance->totemsrp_log_level_notice,
|
|
log_printf (instance->totemsrp_log_level_notice,
|
|
|
- "entering GATHER state.\n");
|
|
|
|
|
|
|
+ "entering GATHER state %d.\n", gather_from);
|
|
|
|
|
|
|
|
instance->memb_state = MEMB_STATE_GATHER;
|
|
instance->memb_state = MEMB_STATE_GATHER;
|
|
|
|
|
|
|
@@ -2199,10 +2209,10 @@ static int orf_token_mcast (
|
|
|
* Build IO vector
|
|
* Build IO vector
|
|
|
*/
|
|
*/
|
|
|
memset (&sort_queue_item, 0, sizeof (struct sort_queue_item));
|
|
memset (&sort_queue_item, 0, sizeof (struct sort_queue_item));
|
|
|
- sort_queue_item.iovec[0].iov_base = message_item->mcast;
|
|
|
|
|
|
|
+ sort_queue_item.iovec[0].iov_base = (char *)message_item->mcast;
|
|
|
sort_queue_item.iovec[0].iov_len = sizeof (struct mcast);
|
|
sort_queue_item.iovec[0].iov_len = sizeof (struct mcast);
|
|
|
|
|
|
|
|
- mcast = sort_queue_item.iovec[0].iov_base;
|
|
|
|
|
|
|
+ mcast = (struct mcast *)sort_queue_item.iovec[0].iov_base;
|
|
|
|
|
|
|
|
memcpy (&sort_queue_item.iovec[1], message_item->iovec,
|
|
memcpy (&sort_queue_item.iovec[1], message_item->iovec,
|
|
|
message_item->iov_len * sizeof (struct iovec));
|
|
message_item->iov_len * sizeof (struct iovec));
|
|
@@ -2394,7 +2404,6 @@ static void timer_function_token_retransmit_timeout (void *data)
|
|
|
case MEMB_STATE_GATHER:
|
|
case MEMB_STATE_GATHER:
|
|
|
break;
|
|
break;
|
|
|
case MEMB_STATE_COMMIT:
|
|
case MEMB_STATE_COMMIT:
|
|
|
- break;
|
|
|
|
|
case MEMB_STATE_OPERATIONAL:
|
|
case MEMB_STATE_OPERATIONAL:
|
|
|
case MEMB_STATE_RECOVERY:
|
|
case MEMB_STATE_RECOVERY:
|
|
|
token_retransmit (instance);
|
|
token_retransmit (instance);
|
|
@@ -2460,7 +2469,7 @@ static int token_send (
|
|
|
return (0);
|
|
return (0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- iovec.iov_base = orf_token;
|
|
|
|
|
|
|
+ iovec.iov_base = (char *)orf_token;
|
|
|
iovec.iov_len = iov_len;
|
|
iovec.iov_len = iov_len;
|
|
|
|
|
|
|
|
totemrrp_token_send (instance->totemrrp_handle,
|
|
totemrrp_token_send (instance->totemrrp_handle,
|
|
@@ -2491,10 +2500,10 @@ static int token_hold_cancel_send (struct totemsrp_instance *instance)
|
|
|
token_hold_cancel.header.nodeid = instance->my_id.addr[0].nodeid;
|
|
token_hold_cancel.header.nodeid = instance->my_id.addr[0].nodeid;
|
|
|
assert (token_hold_cancel.header.nodeid);
|
|
assert (token_hold_cancel.header.nodeid);
|
|
|
|
|
|
|
|
- iovec[0].iov_base = &token_hold_cancel;
|
|
|
|
|
|
|
+ iovec[0].iov_base = (char *)&token_hold_cancel;
|
|
|
iovec[0].iov_len = sizeof (struct token_hold_cancel) -
|
|
iovec[0].iov_len = sizeof (struct token_hold_cancel) -
|
|
|
sizeof (struct memb_ring_id);
|
|
sizeof (struct memb_ring_id);
|
|
|
- iovec[1].iov_base = &instance->my_ring_id;
|
|
|
|
|
|
|
+ iovec[1].iov_base = (char *)&instance->my_ring_id;
|
|
|
iovec[1].iov_len = sizeof (struct memb_ring_id);
|
|
iovec[1].iov_len = sizeof (struct memb_ring_id);
|
|
|
|
|
|
|
|
totemrrp_mcast_flush_send (instance->totemrrp_handle, iovec, 2);
|
|
totemrrp_mcast_flush_send (instance->totemrrp_handle, iovec, 2);
|
|
@@ -2589,10 +2598,15 @@ static int memb_state_commit_token_send (struct totemsrp_instance *instance,
|
|
|
commit_token->memb_index = memb_index_this;
|
|
commit_token->memb_index = memb_index_this;
|
|
|
|
|
|
|
|
|
|
|
|
|
- iovec.iov_base = commit_token;
|
|
|
|
|
|
|
+ iovec.iov_base = (char *)commit_token;
|
|
|
iovec.iov_len = sizeof (struct memb_commit_token) +
|
|
iovec.iov_len = sizeof (struct memb_commit_token) +
|
|
|
((sizeof (struct srp_addr) +
|
|
((sizeof (struct srp_addr) +
|
|
|
sizeof (struct memb_commit_token_memb_entry)) * commit_token->addr_entries);
|
|
sizeof (struct memb_commit_token_memb_entry)) * commit_token->addr_entries);
|
|
|
|
|
+ /*
|
|
|
|
|
+ * Make a copy for retransmission if necessary
|
|
|
|
|
+ */
|
|
|
|
|
+ memcpy (instance->orf_token_retransmit, commit_token, iovec.iov_len);
|
|
|
|
|
+ instance->orf_token_retransmit_size = iovec.iov_len;
|
|
|
|
|
|
|
|
for (i = 0; i < instance->totem_config->interface_count; i++) {
|
|
for (i = 0; i < instance->totem_config->interface_count; i++) {
|
|
|
totemrrp_token_target_set (
|
|
totemrrp_token_target_set (
|
|
@@ -2605,6 +2619,10 @@ static int memb_state_commit_token_send (struct totemsrp_instance *instance,
|
|
|
&iovec,
|
|
&iovec,
|
|
|
1);
|
|
1);
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
|
+ * Request retransmission of the commit token in case it is lost
|
|
|
|
|
+ */
|
|
|
|
|
+ reset_token_retransmit_timeout (instance);
|
|
|
return (0);
|
|
return (0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2704,12 +2722,12 @@ static void memb_join_message_send (struct totemsrp_instance *instance)
|
|
|
memb_join.failed_list_entries = instance->my_failed_list_entries;
|
|
memb_join.failed_list_entries = instance->my_failed_list_entries;
|
|
|
srp_addr_copy (&memb_join.system_from, &instance->my_id);
|
|
srp_addr_copy (&memb_join.system_from, &instance->my_id);
|
|
|
|
|
|
|
|
- iovec[0].iov_base = &memb_join;
|
|
|
|
|
|
|
+ iovec[0].iov_base = (char *)&memb_join;
|
|
|
iovec[0].iov_len = sizeof (struct memb_join);
|
|
iovec[0].iov_len = sizeof (struct memb_join);
|
|
|
- iovec[1].iov_base = &instance->my_proc_list;
|
|
|
|
|
|
|
+ iovec[1].iov_base = (char *)&instance->my_proc_list;
|
|
|
iovec[1].iov_len = instance->my_proc_list_entries *
|
|
iovec[1].iov_len = instance->my_proc_list_entries *
|
|
|
sizeof (struct srp_addr);
|
|
sizeof (struct srp_addr);
|
|
|
- iovec[2].iov_base = &instance->my_failed_list;
|
|
|
|
|
|
|
+ iovec[2].iov_base = (char *)&instance->my_failed_list;
|
|
|
iovec[2].iov_len = instance->my_failed_list_entries *
|
|
iovec[2].iov_len = instance->my_failed_list_entries *
|
|
|
sizeof (struct srp_addr);
|
|
sizeof (struct srp_addr);
|
|
|
|
|
|
|
@@ -2731,10 +2749,10 @@ static void memb_merge_detect_transmit (struct totemsrp_instance *instance)
|
|
|
srp_addr_copy (&memb_merge_detect.system_from, &instance->my_id);
|
|
srp_addr_copy (&memb_merge_detect.system_from, &instance->my_id);
|
|
|
assert (memb_merge_detect.header.nodeid);
|
|
assert (memb_merge_detect.header.nodeid);
|
|
|
|
|
|
|
|
- iovec[0].iov_base = &memb_merge_detect;
|
|
|
|
|
|
|
+ iovec[0].iov_base = (char *)&memb_merge_detect;
|
|
|
iovec[0].iov_len = sizeof (struct memb_merge_detect) -
|
|
iovec[0].iov_len = sizeof (struct memb_merge_detect) -
|
|
|
sizeof (struct memb_ring_id);
|
|
sizeof (struct memb_ring_id);
|
|
|
- iovec[1].iov_base = &instance->my_ring_id;
|
|
|
|
|
|
|
+ iovec[1].iov_base = (char *)&instance->my_ring_id;
|
|
|
iovec[1].iov_len = sizeof (struct memb_ring_id);
|
|
iovec[1].iov_len = sizeof (struct memb_ring_id);
|
|
|
|
|
|
|
|
totemrrp_mcast_flush_send (instance->totemrrp_handle, iovec, 2);
|
|
totemrrp_mcast_flush_send (instance->totemrrp_handle, iovec, 2);
|
|
@@ -3001,6 +3019,7 @@ static void fcc_token_update (
|
|
|
* Message Handlers
|
|
* Message Handlers
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
+struct timeval tv_old;
|
|
|
/*
|
|
/*
|
|
|
* message handler called when TOKEN message type received
|
|
* message handler called when TOKEN message type received
|
|
|
*/
|
|
*/
|
|
@@ -3028,9 +3047,10 @@ static int message_handler_orf_token (
|
|
|
timersub (&tv_current, &tv_old, &tv_diff);
|
|
timersub (&tv_current, &tv_old, &tv_diff);
|
|
|
memcpy (&tv_old, &tv_current, sizeof (struct timeval));
|
|
memcpy (&tv_old, &tv_current, sizeof (struct timeval));
|
|
|
|
|
|
|
|
- if ((((float)tv_diff.tv_usec) / 100.0) > 5.0) {
|
|
|
|
|
- printf ("OTHERS %0.4f ms\n", ((float)tv_diff.tv_usec) / 100.0);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ log_printf (instance->totemsrp_log_level_notice,
|
|
|
|
|
+ "Time since last token %0.4f ms\n",
|
|
|
|
|
+ (((float)tv_diff.tv_sec) * 1000) + ((float)tv_diff.tv_usec)
|
|
|
|
|
+ / 1000.0);
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef TEST_DROP_ORF_TOKEN_PERCENTAGE
|
|
#ifdef TEST_DROP_ORF_TOKEN_PERCENTAGE
|
|
@@ -3201,7 +3221,7 @@ static int message_handler_orf_token (
|
|
|
ring_state_restore (instance);
|
|
ring_state_restore (instance);
|
|
|
|
|
|
|
|
printf ("gather 1");
|
|
printf ("gather 1");
|
|
|
- memb_state_gather_enter (instance);
|
|
|
|
|
|
|
+ memb_state_gather_enter (instance, 5);
|
|
|
} else {
|
|
} else {
|
|
|
instance->my_token_seq = token->token_seq;
|
|
instance->my_token_seq = token->token_seq;
|
|
|
token->token_seq += 1;
|
|
token->token_seq += 1;
|
|
@@ -3274,9 +3294,9 @@ printf ("gather 1");
|
|
|
gettimeofday (&tv_current, NULL);
|
|
gettimeofday (&tv_current, NULL);
|
|
|
timersub (&tv_current, &tv_old, &tv_diff);
|
|
timersub (&tv_current, &tv_old, &tv_diff);
|
|
|
memcpy (&tv_old, &tv_current, sizeof (struct timeval));
|
|
memcpy (&tv_old, &tv_current, sizeof (struct timeval));
|
|
|
- if ((((float)tv_diff.tv_usec) / 100.0) > 5.0) {
|
|
|
|
|
- printf ("I held %0.4f ms\n", ((float)tv_diff.tv_usec) / 100.0);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ log_printf (instance->totemsrp_log_level_notice,
|
|
|
|
|
+ "I held %0.4f ms\n",
|
|
|
|
|
+ ((float)tv_diff.tv_usec) / 1000.0);
|
|
|
#endif
|
|
#endif
|
|
|
if (instance->memb_state == MEMB_STATE_OPERATIONAL) {
|
|
if (instance->memb_state == MEMB_STATE_OPERATIONAL) {
|
|
|
messages_deliver_to_app (instance, 0,
|
|
messages_deliver_to_app (instance, 0,
|
|
@@ -3367,7 +3387,7 @@ static void messages_deliver_to_app (
|
|
|
|
|
|
|
|
sort_queue_item_p = ptr;
|
|
sort_queue_item_p = ptr;
|
|
|
|
|
|
|
|
- mcast = sort_queue_item_p->iovec[0].iov_base;
|
|
|
|
|
|
|
+ mcast = (struct mcast *)sort_queue_item_p->iovec[0].iov_base;
|
|
|
assert (mcast != (struct mcast *)0xdeadbeef);
|
|
assert (mcast != (struct mcast *)0xdeadbeef);
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -3378,7 +3398,8 @@ static void messages_deliver_to_app (
|
|
|
1,
|
|
1,
|
|
|
instance->my_deliver_memb_list,
|
|
instance->my_deliver_memb_list,
|
|
|
instance->my_deliver_memb_entries) == 0) {
|
|
instance->my_deliver_memb_entries) == 0) {
|
|
|
- instance->my_high_delivered = my_high_delivered_stored + i;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ instance->my_high_delivered = my_high_delivered_stored + i;
|
|
|
|
|
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
@@ -3481,7 +3502,7 @@ static int message_handler_mcast (
|
|
|
&mcast_header.system_from, 1,
|
|
&mcast_header.system_from, 1,
|
|
|
instance->my_proc_list, &instance->my_proc_list_entries);
|
|
instance->my_proc_list, &instance->my_proc_list_entries);
|
|
|
printf ("gather 2");
|
|
printf ("gather 2");
|
|
|
- memb_state_gather_enter (instance);
|
|
|
|
|
|
|
+ memb_state_gather_enter (instance, 6);
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
case MEMB_STATE_GATHER:
|
|
case MEMB_STATE_GATHER:
|
|
@@ -3493,7 +3514,7 @@ printf ("gather 2");
|
|
|
|
|
|
|
|
memb_set_merge (&mcast_header.system_from, 1,
|
|
memb_set_merge (&mcast_header.system_from, 1,
|
|
|
instance->my_proc_list, &instance->my_proc_list_entries);
|
|
instance->my_proc_list, &instance->my_proc_list_entries);
|
|
|
- memb_state_gather_enter (instance);
|
|
|
|
|
|
|
+ memb_state_gather_enter (instance, 7);
|
|
|
return (0);
|
|
return (0);
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
@@ -3582,8 +3603,7 @@ static int message_handler_memb_merge_detect (
|
|
|
case MEMB_STATE_OPERATIONAL:
|
|
case MEMB_STATE_OPERATIONAL:
|
|
|
memb_set_merge (&memb_merge_detect->system_from, 1,
|
|
memb_set_merge (&memb_merge_detect->system_from, 1,
|
|
|
instance->my_proc_list, &instance->my_proc_list_entries);
|
|
instance->my_proc_list, &instance->my_proc_list_entries);
|
|
|
-printf ("gather 3");
|
|
|
|
|
- memb_state_gather_enter (instance);
|
|
|
|
|
|
|
+ memb_state_gather_enter (instance, 8);
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
case MEMB_STATE_GATHER:
|
|
case MEMB_STATE_GATHER:
|
|
@@ -3595,8 +3615,7 @@ printf ("gather 3");
|
|
|
|
|
|
|
|
memb_set_merge (&memb_merge_detect->system_from, 1,
|
|
memb_set_merge (&memb_merge_detect->system_from, 1,
|
|
|
instance->my_proc_list, &instance->my_proc_list_entries);
|
|
instance->my_proc_list, &instance->my_proc_list_entries);
|
|
|
-printf ("gather 4");
|
|
|
|
|
- memb_state_gather_enter (instance);
|
|
|
|
|
|
|
+ memb_state_gather_enter (instance, 9);
|
|
|
return (0);
|
|
return (0);
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
@@ -3616,7 +3635,7 @@ static int memb_join_process (
|
|
|
struct totemsrp_instance *instance,
|
|
struct totemsrp_instance *instance,
|
|
|
struct memb_join *memb_join)
|
|
struct memb_join *memb_join)
|
|
|
{
|
|
{
|
|
|
- unsigned char *commit_token_storage[32000];
|
|
|
|
|
|
|
+ unsigned char *commit_token_storage[TOKEN_SIZE_MAX];
|
|
|
struct memb_commit_token *my_commit_token =
|
|
struct memb_commit_token *my_commit_token =
|
|
|
(struct memb_commit_token *)commit_token_storage;
|
|
(struct memb_commit_token *)commit_token_storage;
|
|
|
struct srp_addr *proc_list;
|
|
struct srp_addr *proc_list;
|
|
@@ -3680,7 +3699,7 @@ static int memb_join_process (
|
|
|
memb_join->failed_list_entries,
|
|
memb_join->failed_list_entries,
|
|
|
instance->my_failed_list, &instance->my_failed_list_entries);
|
|
instance->my_failed_list, &instance->my_failed_list_entries);
|
|
|
}
|
|
}
|
|
|
- memb_state_gather_enter (instance);
|
|
|
|
|
|
|
+ memb_state_gather_enter (instance, 10);
|
|
|
return (1); /* gather entered */
|
|
return (1); /* gather entered */
|
|
|
}
|
|
}
|
|
|
return (0); /* gather not entered */
|
|
return (0); /* gather not entered */
|
|
@@ -3824,7 +3843,7 @@ static int message_handler_memb_join (
|
|
|
gather_entered = memb_join_process (instance,
|
|
gather_entered = memb_join_process (instance,
|
|
|
memb_join);
|
|
memb_join);
|
|
|
if (gather_entered == 0) {
|
|
if (gather_entered == 0) {
|
|
|
- memb_state_gather_enter (instance);
|
|
|
|
|
|
|
+ memb_state_gather_enter (instance, 11);
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
@@ -3841,7 +3860,7 @@ static int message_handler_memb_join (
|
|
|
memb_join->ring_seq >= instance->my_ring_id.seq) {
|
|
memb_join->ring_seq >= instance->my_ring_id.seq) {
|
|
|
|
|
|
|
|
memb_join_process (instance, memb_join);
|
|
memb_join_process (instance, memb_join);
|
|
|
- memb_state_gather_enter (instance);
|
|
|
|
|
|
|
+ memb_state_gather_enter (instance, 12);
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
@@ -3856,7 +3875,7 @@ static int message_handler_memb_join (
|
|
|
ring_state_restore (instance);
|
|
ring_state_restore (instance);
|
|
|
|
|
|
|
|
memb_join_process (instance, memb_join);
|
|
memb_join_process (instance, memb_join);
|
|
|
- memb_state_gather_enter (instance);
|
|
|
|
|
|
|
+ memb_state_gather_enter (instance, 13);
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -3877,6 +3896,9 @@ static int message_handler_memb_commit_token (
|
|
|
struct srp_addr *addr;
|
|
struct srp_addr *addr;
|
|
|
struct memb_commit_token_memb_entry *memb_list;
|
|
struct memb_commit_token_memb_entry *memb_list;
|
|
|
|
|
|
|
|
|
|
+ log_printf (instance->totemsrp_log_level_debug,
|
|
|
|
|
+ "got commit token\n");
|
|
|
|
|
+
|
|
|
if (endian_conversion_needed) {
|
|
if (endian_conversion_needed) {
|
|
|
memb_commit_token = memb_commit_token_convert;
|
|
memb_commit_token = memb_commit_token_convert;
|
|
|
memb_commit_token_endian_convert (msg, memb_commit_token);
|
|
memb_commit_token_endian_convert (msg, memb_commit_token);
|
|
@@ -4007,7 +4029,7 @@ void main_iface_change_fn (
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
if (instance->iface_changes >= instance->totem_config->interface_count) {
|
|
if (instance->iface_changes >= instance->totem_config->interface_count) {
|
|
|
- memb_state_gather_enter (instance);
|
|
|
|
|
|
|
+ memb_state_gather_enter (instance, 14);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|