[Openais] Re: totempg config change patch
Steven Dake
sdake at mvista.com
Tue Feb 1 12:38:25 PST 2005
good patch
applied
thanks
-steve
On Tue, 2005-02-01 at 11:37, Mark Haverkamp wrote:
> Steve,
>
> Looking at the totempg config change function, I think that leaving
> members should have their assembly area reset. I assume that any data
> that is there is now invalid, and we wouldn't want it hanging around if
> they return. Also, I think that the wrong index was being used to
> initialize the assembly area index.
>
> Mark.
>
>
>
> ===== exec/totempg.c 1.5 vs edited =====
> --- 1.5/exec/totempg.c 2005-01-31 14:07:14 -08:00
> +++ edited/exec/totempg.c 2005-02-01 10:33:14 -08:00
> @@ -178,6 +178,22 @@
> int j;
> int found;
>
> + /*
> + * Clean out the assembly area for nodes that have left the
> + * membership. If they return, we don't want any stale message
> + * data that may be there.
> + */
> + for (i = 0; i < left_list_entries; i++) {
> + for (j = 0; j < assembly_list_entries; j++) {
> + if (left_list[i].s_addr == assembly_list[j]->addr.s_addr) {
> + assembly_list[j]->index = 0;
> + }
> + }
> + }
> +
> + /*
> + * Create a message assembly area for any new members.
> + */
> for (i = 0; i < member_list_entries; i++) {
> found = 0;
> for (j = 0; j < assembly_list_entries; j++) {
> @@ -190,8 +206,9 @@
> assembly_list[assembly_list_entries] =
> malloc (sizeof (struct assembly));
> assert (assembly_list[assembly_list_entries]); // TODO
> - assembly_list[assembly_list_entries]->addr.s_addr = member_list[i].s_addr;
> - assembly_list[i]->index = 0;
> + assembly_list[assembly_list_entries]->addr.s_addr =
> + member_list[i].s_addr;
> + assembly_list[assembly_list_entries]->index = 0;
> assembly_list_entries += 1;
> }
> }
More information about the Openais
mailing list