瀏覽代碼

Add assembly to free list when it is removed from a configuration change as
indicated by being in the left list.

This has side effect of clearing the assembly buffer the next time it is
referenced from the free list. This fixes a defect that stops forward
processing of the message streams because sync fails to finish when receiving
a sync message from a restarted processor because it throws away the message.




git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2288 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 17 年之前
父節點
當前提交
5780b2b660
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      exec/totempg.c

+ 12 - 0
exec/totempg.c

@@ -326,8 +326,19 @@ static inline void app_confchg_fn (
 {
 	int i;
 	struct totempg_group_instance *instance;
+	struct assembly *assembly;
 	unsigned int res;
 
+	/*
+	 * For every leaving processor, add to free list
+	 * This also has the side effect of clearing out the dataset
+	 * In the leaving processor's assembly buffer.
+	 */
+	for (i = 0; i < left_list_entries; i++) {
+		assembly = assembly_ref (left_list[i]);
+		list_del (&assembly->list);
+		list_add (&assembly->list, &assembly_list_free);
+	}
 	for (i = 0; i <= totempg_max_handle; i++) {
 		res = hdb_handle_get (&totempg_groups_instance_database,
 			hdb_nocheck_convert (i), (void *)&instance);
@@ -588,6 +599,7 @@ static void totempg_deliver_fn (
 	if (assembly->throw_away_mode == THROW_AWAY_ACTIVE) {
 		 /* Throw away the first msg block */
 		if (mcast->fragmented == 0 || mcast->fragmented == 1) {
+printf ("throwing away first message block\n");
 			assembly->throw_away_mode = THROW_AWAY_INACTIVE;
 
 			assembly->index += msg_lens[0];