[Openais] totempg config change patch

Mark Haverkamp markh at osdl.org
Tue Feb 1 10:37:50 PST 2005


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;
 		}
 	}

-- 
Mark Haverkamp <markh at osdl.org>




More information about the Openais mailing list