Просмотр исходного кода

Correction to a problem when a cluster consisting of several nodes starts
initially in an order such that at least two nodes start after at least one
node has been started and its SUs has been instantiated.


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

Hans Feldt 19 лет назад
Родитель
Сommit
86431dfc6d
3 измененных файлов с 16 добавлено и 13 удалено
  1. 3 0
      exec/amf.c
  2. 0 7
      exec/amfcluster.c
  3. 13 6
      exec/amfnode.c

+ 3 - 0
exec/amf.c

@@ -1527,6 +1527,9 @@ static int amf_lib_init_fn (void *conn)
 
 static void amf_dump_fn (void)
 {
+	if (amf_cluster == NULL) {
+		return;
+	}
 	amf_runtime_attributes_print (amf_cluster);
 }
 

+ 0 - 7
exec/amfcluster.c

@@ -144,13 +144,6 @@ void amf_cluster_sync_ready (struct amf_cluster *cluster)
 			break;
 		}
 		case CLUSTER_STARTING_COMPONENTS: {
-			if (cluster->timeout_handle) {
-
-				poll_timer_delete (
-					aisexec_poll_handle, cluster->timeout_handle);
-
-				cluster->timeout_handle = 0;
-			}
 			break;
 		}
 		case CLUSTER_STARTING_WORKLOAD: {

+ 13 - 6
exec/amfnode.c

@@ -355,11 +355,18 @@ static int all_applications_on_node_started (struct amf_node *node,
 	for (app = cluster->application_head; app != NULL; app = app->next) {
 		for (sg = app->sg_head; sg != NULL; sg = sg->next) {
 			for (su = sg->su_head; su != NULL; su = su->next) {
-				if (su->saAmfSUPresenceState != SA_AMF_PRESENCE_INSTANTIATED && 
+ /*	TODO: Replace the if-statement below with the if-statement in this comment when
+	   	the real problem is fixed !
+  			if (su->saAmfSUPresenceState != SA_AMF_PRESENCE_INSTANTIATED && 
 					name_match(&su->saAmfSUHostedByNode,&node->name)) {
 					all_started = 0;
 					goto done;
 				}
+*/
+				if (su->saAmfSUPresenceState != SA_AMF_PRESENCE_INSTANTIATED ) {
+					all_started = 0;
+					goto done;
+				}
 			}
 		}
 	}
@@ -380,13 +387,13 @@ void amf_node_application_started (struct amf_node *node,
 
 		log_printf(LOG_NOTICE,
 			"Node: all applications started, assigning workload.");
-	}
 
-
-	for (app = _app->cluster->application_head; app != NULL; 
-		app = app->next) {
-		amf_application_assign_workload (app, node);
+		for (app = _app->cluster->application_head; app != NULL; 
+			app = app->next) {
+			amf_application_assign_workload (app, node);
+		}
 	}
+
 }
 
 void amf_node_application_workload_assigned (struct amf_node *node,