From 86431dfc6dc2f045f0d78e853d0decaa809b2cbb Mon Sep 17 00:00:00 2001 From: Hans Feldt Date: Wed, 20 Sep 2006 08:27:01 +0000 Subject: [PATCH] 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 --- exec/amf.c | 3 +++ exec/amfcluster.c | 7 ------- exec/amfnode.c | 19 +++++++++++++------ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/exec/amf.c b/exec/amf.c index 7ace0573..89e156d7 100644 --- a/exec/amf.c +++ b/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); } diff --git a/exec/amfcluster.c b/exec/amfcluster.c index 9cce4d72..b2d78ad8 100644 --- a/exec/amfcluster.c +++ b/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: { diff --git a/exec/amfnode.c b/exec/amfnode.c index 003f35a3..5abd53e8 100644 --- a/exec/amfnode.c +++ b/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,