Commit e5e7863a authored by Shane Snyder's avatar Shane Snyder
Browse files

port last 2 swim functions over

parent db4e461a
......@@ -73,7 +73,6 @@ void swim_dping_send_ult(
void swim_iping_send_ult(
void *t_arg);
#if 0
/* SWIM membership update function prototypes */
void swim_retrieve_membership_updates(
ssg_group_t *g,
......@@ -83,7 +82,6 @@ void swim_apply_membership_updates(
ssg_group_t *g,
swim_member_update_t *updates,
int update_count);
#endif
#ifdef __cplusplus
}
......
......@@ -378,10 +378,8 @@ static void swim_pack_message(ssg_group_t *g, swim_message_t *msg)
msg->source_id = g->self_rank;
msg->source_inc_nr = swim_ctx->member_inc_nrs[g->self_rank];
#if 0
/* piggyback a set of membership states on this message */
swim_retrieve_membership_updates(g, msg->pb_buf, SWIM_MAX_PIGGYBACK_ENTRIES);
#endif
return;
}
......@@ -394,12 +392,10 @@ static void swim_unpack_message(ssg_group_t *g, swim_message_t *msg)
sender_update.id = msg->source_id;
sender_update.status = SWIM_MEMBER_ALIVE;
sender_update.inc_nr = msg->source_inc_nr;
#if 0
swim_apply_membership_updates(g, &sender_update, 1);
/* update membership status using piggybacked membership updates */
swim_apply_membership_updates(g, msg->pb_buf, SWIM_MAX_PIGGYBACK_ENTRIES);
#endif
return;
}
......
......@@ -246,13 +246,12 @@ void swim_finalize(swim_context_t *swim_ctx)
* SWIM membership update functions *
************************************/
#if 0
void swim_retrieve_membership_updates(
ssg_t s,
ssg_group_t *g,
swim_member_update_t *updates,
int update_count)
{
swim_context_t *swim_ctx = s->swim_ctx;
swim_context_t *swim_ctx = (swim_context_t *)g->fd_ctx;
swim_member_update_link_t *iter, *tmp;
swim_member_update_link_t **recent_update_list_p =
(swim_member_update_link_t **)&(swim_ctx->recent_update_list);
......@@ -285,12 +284,12 @@ void swim_retrieve_membership_updates(
}
void swim_apply_membership_updates(
ssg_t s,
ssg_group_t *g,
swim_member_update_t *updates,
int update_count)
{
swim_context_t *swim_ctx = s->swim_ctx;
swim_member_id_t self_id = s->view.self_rank;
swim_context_t *swim_ctx = (swim_context_t *)g->fd_ctx;
swim_member_id_t self_id = g->self_rank;
int i;
for(i = 0; i < update_count; i++)
......@@ -307,7 +306,7 @@ void swim_apply_membership_updates(
}
else
{
swim_unsuspect_member(s, updates[i].id, updates[i].inc_nr);
swim_unsuspect_member(g, updates[i].id, updates[i].inc_nr);
}
break;
case SWIM_MEMBER_SUSPECT:
......@@ -320,13 +319,13 @@ void swim_apply_membership_updates(
if(updates[i].inc_nr == swim_ctx->member_inc_nrs[self_id])
{
swim_ctx->member_inc_nrs[self_id]++;
SSG_DEBUG(s, "SWIM: self SUSPECT received (new inc_nr=%d)\n",
SSG_DEBUG(g, "SWIM: self SUSPECT received (new inc_nr=%d)\n",
swim_ctx->member_inc_nrs[self_id]);
}
}
else
{
swim_suspect_member(s, updates[i].id, updates[i].inc_nr);
swim_suspect_member(g, updates[i].id, updates[i].inc_nr);
}
break;
case SWIM_MEMBER_DEAD:
......@@ -336,24 +335,23 @@ void swim_apply_membership_updates(
assert(updates[i].inc_nr <= swim_ctx->member_inc_nrs[self_id]);
swim_ctx->member_inc_nrs[self_id] = updates[i].inc_nr;
SSG_DEBUG(s, "SWIM: self confirmed DEAD (inc_nr=%d)\n",
SSG_DEBUG(g, "SWIM: self confirmed DEAD (inc_nr=%d)\n",
swim_ctx->member_inc_nrs[self_id]);
swim_finalize(swim_ctx);
}
else
{
swim_kill_member(s, updates[i].id, updates[i].inc_nr);
swim_kill_member(g, updates[i].id, updates[i].inc_nr);
}
break;
default:
SSG_DEBUG(s, "SWIM: invalid membership status update\n");
SSG_DEBUG(g, "SWIM: invalid membership status update\n");
}
}
return;
}
#endif
/*******************************************
* SWIM group membership utility functions *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment