Procházet zdrojové kódy

1 The patch contains mainly updates of the header documentation in the
amf_files
2 Correction of the misspelling in lib/cfg.c


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

Lon Hohberger před 19 roky
rodič
revize
79df855070
6 změnil soubory, kde provedl 198 přidání a 132 odebrání
  1. 0 1
      exec/amf.h
  2. 27 27
      exec/amfapp.c
  3. 120 75
      exec/amfcluster.c
  4. 49 26
      exec/amfnode.c
  5. 0 1
      exec/totemip.c
  6. 2 2
      lib/cfg.c

+ 0 - 1
exec/amf.h

@@ -749,7 +749,6 @@ extern void amf_cluster_sync_ready (struct amf_cluster *cluster,
  * @param app
  */
 extern void amf_cluster_start_applications(struct amf_cluster *cluster);
-extern void amf_cluster_assign_workload (struct amf_cluster *cluster);
 
 /* Response event methods */
 extern void amf_cluster_application_started (

+ 27 - 27
exec/amfapp.c

@@ -37,7 +37,7 @@
  * 
  * AMF Application Class implementation
  * 
- * This file contains functions for handling the AMF applications. It can 
+ * This file contains functions for handling the AMF Applications. It can 
  * be viewed as the implementation of the AMF Application class
  * as described in SAI-Overview-B.02.01. The SA Forum specification 
  * SAI-AIS-AMF-B.02.01 has been used as specification of the behaviour
@@ -49,28 +49,28 @@
  *    service units contained in the service group, level by level
  *	- to handle administrative operation support for the application (FUTURE)
  *
- * The cluster class contains the following state machines:
+*  The application class contains the following state machines:
  *	- administrative state machine (ADSM)
  *	- availability control state machine (ACSM)
  *
  * The administrative state machine will be implemented in the future.
  *
- * ACSM handles initial start of an application. In the future it will also
+ * ACSM handles initial start of an Application. In the future it will also
  * handle administrative commands on the application as described in paragraph
  * 7.4 of the spec. ACSM includes two stable states (UNINSTANTIATED and
- * STARTED) and a number of states to control the transition between the
- * stable states.
+ * WORKLOAD_ASSIGNED) and a number of states to control the transition between
+ * the stable states.
  *
  * The application is in state UNINSTANTIATED when the application starts.
  * (In the future this state will also be assumed after the LOCK_INSTANTIATION
  * administrative command.)
  *
- * State WORKLOAD_ASSIGNED is assumed when the application has been initially
+ * State WORKLOAD_ASSIGNED is assumed when the Application has been initially
  * started and will in the future be re-assumed after the administrative
  * command RESTART have been executed.
  * 
- * 1. AMF Synchronization Control State Machine
- * =========================================
+*  1. AMF Application Availability Control State Machine
+*  =====================================================
  * 
  * 1.1  State Transition Table
  * 
@@ -79,20 +79,22 @@
  * UNINSTANTIATED          start                 A6,A1    STARTING_SGS
  * STARTING_SGS            start [C4]            A7
  * STARTING_SGS            sg_started [C1]       A8,A9    STARTED
+ * STARTING_SGS            assign_workload [C4]  A3       ASSIGNING_WORKLOAD
  * STARTED                 start                 A6,A1    STARTING_SGS
+ * STARTED                 start [!C4]           A7       STARTED
  * STARTED                 assign_workload       A3       ASSIGNING_WORKLOAD
- * ASSIGNING_WORKLOAD      assign_workload       A7
- * ASSIGNING_WORKLOAD      start                 A7
+ * ASSIGNING_WORKLOAD      assign_workload       A7       ASSIGNING_WORKLOAD
+ * ASSIGNING_WORKLOAD      start                 A7       ASSIGNING_WORKLOAD
  * ASSIGNING_WORKLOAD      sg_assigned [C2]      A10,A9   WORKLOAD_ASSIGNED
  * WORKLOAD_ASSIGNED       start                 A6,A1    STARTING_SGS
  * WORKLOAD_ASSIGNED       assign_workload       A3       ASSIGNING_WORKLOAD
 * 
 *  1.2 State Description
 *  =====================
-* UNINSTANTIATED -  No SUs within the SGs contained in the application have been
+* UNINSTANTIATED -  No SUs within the SGs contained in the Application have been
 *                   instantiated.
 * STARTING_SGS - Waiting for the contained SGs to start.
-* STARTED - No SUs within the SGs contained in the application are in the
+* STARTED - No SUs within the SGs contained in the Application are in the
 *           process of beein instantiated. Either the SUs are instantiated or
 *           instantiation was not possible or instantiation has failed.
 * ASSIGNING_WORKLOAD - Waiting for the contained SGs to indicate they have
@@ -102,9 +104,9 @@
 * 
 *  1.3 Actions
 *  ===========
-*  A1 - [foreach sg in application] sg_start
+*  A1 - [foreach SG in Application] sg_start
 *  A2 -
-*  A3 - [foreach sg in application] sg_assign
+*  A3 - [foreach SG in Application] sg_assign
 *  A4 -
 *  A5 -
 *  A6 - save value of received node parameter
@@ -116,10 +118,10 @@
 * 
 *  1.4 Guards
 *  ==========
-*  C1 - No sg has availability control state == INSTANTIATING_SERVICE_UNITS
-*  C2 - All sgs have availability control state == IDLE
+*  C1 - No SU has presence state == INSTANTIATING
+*  C2 - All SGs have availability control state == IDLE
 *  C3 -
-*  C4 - saved node value != received node value
+*  C4 - Sender is Cluster
 */
 
 #include <assert.h>
@@ -127,16 +129,16 @@
 #include "print.h"
 #include "util.h"
 
-/******************************************************************************
- * Internal (static) utility functions
- *****************************************************************************/
-
 typedef struct application_event {
 	amf_application_event_type_t event_type;  
 	amf_application_t *app;
 	amf_node_t	*node;
 } application_event_t;
 
+/******************************************************************************
+ * Internal (static) utility functions
+ *****************************************************************************/
+
 static	int is_cluster_start(amf_node_t *node_to_start)
 {
 	return node_to_start == NULL;
@@ -152,7 +154,6 @@ static void application_defer_event (
 		sizeof (application_event_t), &app_event);
 }
 
-
 static void application_recall_deferred_events (amf_application_t *app)
 {
 	application_event_t  application_event;
@@ -181,6 +182,7 @@ static void application_recall_deferred_events (amf_application_t *app)
 		}
 	}
 }
+
 static void timer_function_application_recall_deferred_events (void *data)
 {
 	amf_application_t *app = (amf_application_t*)data;
@@ -204,7 +206,6 @@ static int no_su_is_instantiating (struct amf_application *app)
 		}
 	}
 	return all_su_instantiated;
-
 }
 
 static int all_sg_assigned (struct amf_application *app)
@@ -247,6 +248,7 @@ static void timer_function_node_application_started (void* app)
 	amf_application_t *application = (amf_application_t*)app;
 	amf_node_application_started (application->node_to_start, application);
 }
+
 static void application_enter_starting_sgs (struct amf_application *app, 
 	struct amf_node *node)
 {
@@ -305,8 +307,6 @@ static void application_enter_workload_assigned (amf_application_t *app)
 		amf_call_function_asynchronous (
 			timer_function_application_recall_deferred_events, app);
 	}
-
-
 }
 
 /******************************************************************************
@@ -337,7 +337,6 @@ void amf_application_start (
 			} else { /*is_not_cluster_start*/
 				application_defer_event (APPLICATION_START_EV, app , node);
 			}
-
 			break;
 		case APP_AC_ASSIGNING_WORKLOAD:
 			log_printf (LOG_LEVEL_ERROR, "Request to start application"
@@ -354,7 +353,6 @@ void amf_application_start (
 	}
 }
 
-
 void amf_application_assign_workload (struct amf_application *app, 
 	struct amf_node *node)
 {
@@ -407,6 +405,7 @@ void amf_application_assign_workload (struct amf_application *app,
 /******************************************************************************
  * Event response methods
  *****************************************************************************/
+
 void amf_application_sg_started (struct amf_application *app, struct amf_sg *sg,
 		struct amf_node *node)
 {
@@ -455,6 +454,7 @@ void amf_application_sg_assigned (
 /******************************************************************************
  * General methods
  *****************************************************************************/
+
 void amf_application_init (void)
 {
 	log_init ("AMF");

+ 120 - 75
exec/amfcluster.c

@@ -78,13 +78,16 @@
  * STARTING_APPS           sync_ready            A2,A1    STARTING_APPS
  * STARTING_APPS           app_started [C3]      A7,A3    ASSIGNING_WORKLOAD
  * STARTING_APPS           local_timer_expired   A8       STARTING_APPS
- * STARTING_APPS           time_out [C2]         A7,A3    ASSIGNING_WORKLOAD
- * STARTING_APPS           time_out              A7       WAITING_OVERTIME
- * WAITING_OVERTIME        sync_ready            A4       WAITING_OVERTIME
- * WAITING_OVERTIME        app_started           A3       ASSIGNING_WORKLOAD
+ * STARTING_APPS           time_out              A7,A8    WAITING_OVERTIME_1
+ * WAITING_OVERTIME_1      sync_ready            A4       WAITING_OVERTIME_1
+ * WAITING_OVERTIME_1      time_out [C2]         A7       ASSIGNING_WORKLOAD
+ * WAITING_OVERTIME_1      time_out              A7       WAITING_OVERTIME_2
+ * WAITING_OVERTIME_1      app_started [C2]      A3       ASSIGNING_WORKLOAD
+ * WAITING_OVERTIME_2      sync_ready            A4       WAITING_OVERTIME_2
+ * WAITING_OVERTIME_2      app_started [C2]      A3       ASSIGNING_WORKLOAD
  * ASSIGNING_WORKLOAD      sync_ready            A4       ASSIGNING_WORKLOAD
  * ASSIGNING_WORKLOAD      app_assigned [C4]     A6       STARTED
- * STARTED                 sync_ready            A8       STARTED
+ * STARTED                 sync_ready            A5       STARTED
  * 
  * 1.2 State Description
  * =====================
@@ -93,17 +96,23 @@
  *                         their contained SGs, which in its turn has requested
  *                         their contained SUs to instantiate all their 
  *                         components. The cluster startup timer is running.
- * WAITING_OVERTIME - The cluster startup timer has expired but all
- *                    applications have yet not responded that they have been
- *                    started. Cluster will wait infinitely for the
- *                    applications to respond. It is correct to do so even when
- *                    the startup timer has expired, because the applications
- *                    will report they are started as soon as there is no
- *                    attempt to instantiate any of its components pending,
- *                    because attempts to instantiate a component can not go on
- *                    forever, see saAmfCompInstantiateTimeout,
- *                    saAmfCompNumMaxInstantiateWithoutDelay and
- *                    saAmfCompNumMaxInstantiateWithDelay.
+ * WAITING_OVERTIME_1 - The cluster startup timer has expired but all
+ *                      applications have yet not responded that they have been
+ *                      started. The time-out message is broadcasted again to
+ *						make sure there are no other broadcast messages pending.
+ *						(This assures first of all that there is no pending
+ *						'component instantiate' message.)
+ * WAITING_OVERTIME_2 - The cluster startup timer has expired but all
+ *                      applications have yet not responded that they have been
+ *                      started. Cluster will wait infinitely for the
+ *                      applications to respond. It is correct to do so even when
+ *                      the startup timer has expired, because the applications
+ *                      will report they are started as soon as there is no
+ *                      attempt to instantiate any of its components pending,
+ *                      because attempts to instantiate a component can not go on
+ *                      forever, see saAmfCompInstantiateTimeout,
+ *                      saAmfCompNumMaxInstantiateWithoutDelay and
+ *                      saAmfCompNumMaxInstantiateWithDelay.
  * ASSIGNING_WORKLOAD - All applications have been requested to assign it's
  *                      specified workload to it's service units according to
  *                      the redundancy model specified by it's SGs.
@@ -120,13 +129,14 @@
  * A5 - forward sync_ready to appropriate node object
  * A6 - recall deferred event
  * A7 - stop node local instance of cluster startup timer
- * A8 - multicast 'cluster startup timer time-out' event
+ * A8 - multicast 'cluster startup timer time-out' event (time_out)
  *
  * 1.4 Guards
  * ==========
- * C1 - No sg has availability control state == INSTANTIATING_SERVICE_UNITS
- * C2 - No application has Availability Control state == STARTING_SGS
+ * C1 - Administrative state == UNLOCKED
+ * C2 - No SU has presence state == INSTANTIATING
  * C3 - All SGs are fully instantiated
+ * C4 - No Application has Availability Control state == ASSIGNING_WORKLOAD
  */
 
 
@@ -139,17 +149,15 @@
 #include "main.h"
 #include "service.h"
 
-/******************************************************************************
- * Internal (static) utility functions
- *****************************************************************************/
-
- 
 typedef struct cluster_event {
 	amf_cluster_event_type_t event_type;
 	amf_cluster_t *cluster;
 	amf_node_t *node;
 } cluster_event_t;
 
+/******************************************************************************
+ * Internal (static) utility functions
+ *****************************************************************************/
 
 static void cluster_defer_event (amf_cluster_event_type_t event_type, 
 	struct amf_cluster *cluster, struct amf_node * node)
@@ -189,10 +197,10 @@ static void timer_function_cluster_recall_deferred_events (void *data)
 
 /**
  * Determine if all applications are started so that all
- * SUs is in SA_AMF_PRESENCE_INSTANTIATED prsense state
+ * SUs is in SA_AMF_PRESENCE_INSTANTIATED presense state
  * @param cluster
  * 
- * @return int
+ * @return 1; All applications are started
  */
 static int cluster_applications_started_instantiated (struct amf_cluster *cluster)
 {
@@ -216,6 +224,12 @@ static int cluster_applications_started_instantiated (struct amf_cluster *cluste
 	return all_started;
 }
 
+/**
+ * Determine if any SGs are in the process of instantiating their SUs.
+ * @param cluster
+ * 
+ * @return 1; At least one SG is in the process of instantiating.
+ */
 static int cluster_applications_are_starting_sgs(struct amf_cluster *cluster)
 {
 	amf_application_t *application;
@@ -239,6 +253,16 @@ static int cluster_applications_are_starting_sgs(struct amf_cluster *cluster)
 	return is_starting_sgs;
 }
 
+static void amf_cluster_assign_workload (struct amf_cluster *cluster)
+{
+	struct amf_application *app;
+	ENTER ("");
+
+	for (app = cluster->application_head; app != NULL; app = app->next) {
+		amf_application_assign_workload (app, NULL);
+	}
+}
+
 static void acsm_cluster_enter_assigning_workload (struct amf_cluster *cluster)
 {
 	log_printf(LOG_NOTICE,
@@ -299,13 +323,6 @@ static void acsm_cluster_enter_started (amf_cluster_t *cluster)
  * Event methods
  *****************************************************************************/
 
-
-int amf_cluster_applications_started_with_no_starting_sgs (
-struct amf_cluster *cluster)
-{
-	return !cluster_applications_are_starting_sgs (cluster);
-}
-
 void amf_cluster_start_tmo_event (int is_sync_masterm, 
 	struct amf_cluster *cluster, SaNameT *sourceNodeName)
 {
@@ -364,8 +381,12 @@ void amf_cluster_start_applications(struct amf_cluster *cluster)
 	}
 }
 
-
-
+/**
+ * A new node has joined the cluster and is now synchronized with the nodes that
+ * was part of the cluster before.
+ * @param cluster
+ * @param node
+ */
 void amf_cluster_sync_ready (struct amf_cluster *cluster, struct amf_node *node)
 {
 	ENTER ("");
@@ -386,10 +407,6 @@ void amf_cluster_sync_ready (struct amf_cluster *cluster, struct amf_node *node)
 			 */
 			cluster_defer_event (CLUSTER_SYNC_READY_EV, cluster,
 				node);
-			log_printf (LOG_LEVEL_ERROR, 
-				"Sync ready not implemented in "
-				"cluster state: %u\n", amf_cluster->acsm_state);
-			assert (0);
 			break;
 		case CLUSTER_AC_WAITING_OVER_TIME_2:
 			/*
@@ -406,18 +423,25 @@ void amf_cluster_sync_ready (struct amf_cluster *cluster, struct amf_node *node)
 			break;
 
 		default:
+			log_printf(LOG_LEVEL_ERROR, "Cluster sync ready event"
+				" received in wrong cluster"
+				" state = %d", cluster->acsm_state);
 			assert (0);
 			break;
 	}
 }
 
-void amf_cluster_init (void)
-{
-	log_init ("AMF");
-}
-
-
+/******************************************************************************
+ * Event response methods
+ *****************************************************************************/
 
+/**
+ * An application indicates it has been started or the application indicates it
+ * was not even possible to try to start because the required nodes were not
+ * available. 
+ * @param cluster
+ * @param application
+ */
 void amf_cluster_application_started (
 	struct amf_cluster *cluster, struct amf_application *application)
 {
@@ -445,32 +469,10 @@ void amf_cluster_application_started (
 	}
 }
 
-struct amf_cluster *amf_cluster_new (void) 
-{
-	struct amf_cluster *cluster = amf_calloc (1, 
-					sizeof (struct amf_cluster));
-
-	cluster->saAmfClusterStartupTimeout = -1;
-	cluster->saAmfClusterAdminState = SA_AMF_ADMIN_UNLOCKED;
-	cluster->deferred_events = 0;
-	cluster->acsm_state = CLUSTER_AC_UNINSTANTIATED; 
-	return cluster;
-}
-
-int amf_cluster_applications_assigned (struct amf_cluster *cluster)
-{
-	struct amf_application *app = 0;
-	int is_all_application_assigned = 1;
-
-	for (app = cluster->application_head; app != NULL; app = app->next) {
-		if (app->acsm_state !=  APP_AC_WORKLOAD_ASSIGNED) {
-			is_all_application_assigned = 0;
-			break;
-		}
-	}
-	return is_all_application_assigned;
-}
-
+/**
+ * An application indicates it has assigned workload to all its contained SUs. 
+ * @param cluster
+ */
 void amf_cluster_application_workload_assigned (
 	struct amf_cluster *cluster, struct amf_application *app)
 {
@@ -489,6 +491,27 @@ void amf_cluster_application_workload_assigned (
 	}
 }
 
+/******************************************************************************
+ * General methods
+ *****************************************************************************/
+
+void amf_cluster_init (void)
+{
+	log_init ("AMF");
+}
+
+struct amf_cluster *amf_cluster_new (void) 
+{
+	struct amf_cluster *cluster = amf_calloc (1, 
+					sizeof (struct amf_cluster));
+
+	cluster->saAmfClusterStartupTimeout = -1;
+	cluster->saAmfClusterAdminState = SA_AMF_ADMIN_UNLOCKED;
+	cluster->deferred_events = 0;
+	cluster->acsm_state = CLUSTER_AC_UNINSTANTIATED; 
+	return cluster;
+}
+
 void *amf_cluster_serialize (struct amf_cluster *cluster, int *len)
 {
 	char *buf = NULL;
@@ -524,14 +547,36 @@ struct amf_cluster *amf_cluster_deserialize (char *buf)
 	return cluster;
 }
 
-void amf_cluster_assign_workload (struct amf_cluster *cluster)
+/**
+ * Determine if any SGs are in the process of instantiating their SUs.
+ * @param cluster
+ * 
+ * @return 1; At least one SG is in the process of instantiating.
+ */
+int amf_cluster_applications_started_with_no_starting_sgs (
+struct amf_cluster *cluster)
 {
-	struct amf_application *app;
-	ENTER ("");
+	return !cluster_applications_are_starting_sgs (cluster);
+}
+
+/**
+ * Determine if all Applications have been assigned workload.
+ * @param cluster
+ * 
+ * @return 1; All Applications have been assigned workload.
+ */
+int amf_cluster_applications_assigned (struct amf_cluster *cluster)
+{
+	struct amf_application *app = 0;
+	int is_all_application_assigned = 1;
 
 	for (app = cluster->application_head; app != NULL; app = app->next) {
-		amf_application_assign_workload (app, NULL);
+		if (app->acsm_state !=  APP_AC_WORKLOAD_ASSIGNED) {
+			is_all_application_assigned = 0;
+			break;
+		}
 	}
+	return is_all_application_assigned;
 }
 
 

+ 49 - 26
exec/amfnode.c

@@ -68,19 +68,19 @@
  * Being a composite state means that the state contains substates.
  * ACSM states are:
  *	- REPAIR_NEEDED
- *	- ESCALLATION_LEVEL (LEVEL_0, LEVEL_2 and LEVEL_3)
+ *	- IDLE (ESCALATION_LEVEL_0, ESCALATION_LEVEL_2 and ESCALATION_LEVEL_3)
  *	- MANAGING_HOSTED_SERVICE_UNITS (
  *		. FAILING_FAST (REBOOTING_NODE and ACTIVATING_STANDBY_NODE)
  *		. FAILING_GRACEFULLY (SWITCHING_OVER, FAILING_OVER and REBOOTING_NODE)
- *      . LEAVING_SPONTANEOUSLY (FAILING_OVER and
+ *      . LEAVING_SPONTANEOUSLY (SWITCHING_OVER, FAILING_OVER and
  *								 WAITING_FOR_NODE_TO_JOIN)
- *      . JOINING (STARTING_SERVICE_UNITS and ASSIGNING_STANDBY_WORKLOAD)
+ *      . JOINING (STARTING_APPLICATIONS and ASSIGNING_WORKLOAD)
  * 
  * REPAIR_NEEDED indicates the node needs a manual repair and this state will be
  * maintained until the administrative command REPAIRED is entered (implemented
  * in the future)
  *
- * ESCALLATION_LEVEL is a kind of idle state where no actions are performed
+ * IDLE is a composite state where no actions are actually performed
  * and used only to remember the escallation level. Substate LEVEL_0 indicates
  * no escallation. LEVEL_2 indicates that so many component restarts have been 
  * executed recently that a new component restart request will escalate 
@@ -91,7 +91,7 @@
  * the recovery action performed is service unit failover (paragraph 3.12.1.3).
  * 
  * FAILING_FAST state executes a node re-boot and waits for the node to join
- * the cluster again.
+ * the cluster again. (not implemented)
  *
  * FAILING_GRACEFULLY state requests all SGs which have SUs hosted on current
  * node to switch or failover according to the procedures described in
@@ -111,21 +111,37 @@
  * 
  * State:                  Event:              Action:  New state:
  * ============================================================================
- * ESCALATION_LEVEL_0      node_sync_ready     A6       JOINING_STARTING_APPLS
- * ESCALATION_LEVEL_0      node_leave          A9,A8    LEAVING_SP_FAILING_OVER
+ * ESCALATION_LEVEL_X      node_sync_ready     A6       JOINING_STARTING_APPLS
+ * ESCALATION_LEVEL_X      node_leave          A9,A8    LEAVING_SP_FAILING_OVER
+ * ESCALATION_LEVEL_X	   failover            A11		GRACEFULLY_FAILING_OVER
+ * ESCALATION_LEVEL_2      comp_restart_req [!C6]A13	ESCALATION_LEVEL_2
+ * ESCALATION_LEVEL_2      comp_restart_req [C6]A14		ESCALATION_LEVEL_3
+ * ESCALATION_LEVEL_3	   comp_restart_req [!C7]A14    ESCALATION_LEVEL_3
+ * ESCALATION_LEVEL_3      comp_failover_req [!C7]A14   ESCALATION_LEVEL_3
+ * ESCALATION_LEVEL_3	   comp_restart_req [C7]A15     ESCALATION_LEVEL_3
+ * ESCALATION_LEVEL_3      comp_failover_req [C7]A15    ESCALATION_LEVEL_3
  * JOINING_STARTING_APPLS  appl_started [C4]   A7       JOINING_ASSIGNING_WL
- * JOINING_ASSIGNING_WL    appl_assigned [C5]           ESCALATION_LEVEL_0
+ * JOINING_ASSIGNING_WL    appl_assigned [C5]           ESCALATION_LEVEL_X
  * LEAVING_SP_FAILING_OVER sg_failed_over [C1]          LEAVING_SP_WAIT_FOR_JOIN
  * LEAVING_SP_WAIT_FOR_JOIN node_sync_ready    A6       JOINING_STARTING_APPLS
+ * GRACEFULLY_FAILING_OVER sg_failed_over [C1] A12      GRACEFULLY_REBOOTING
+ * GRACEFULLY_REBOOTING    node_leave					ESCALATION_LEVEL_X
  * 
  *  1.2 State Description
  *  =====================
- * ESCALATION_LEVEL_0 -  Node is synchronized and idle.
+ * ESCALATION_LEVEL_X -  Node is synchronized and idle (X = 0,2 or 3).
  * JOINING_STARTING_APPLS - JOINING_STARTING_APPLICATIONS
  *                          Node has ordered all applications to start its SUs
  *                          hosted on current node and is now waiting for them
  *                          to acknowledge that they have started.
- *
+ * GRACEFULLY_FAILING_OVER - FAILING_GRACEFULLY_FAILING_OVER
+ *							 Node has ordered all SGs in the cluster to
+ *							 failover all SUs that are hosted on a specific
+ *							 node and waits for the SGs to confirm the
+ *							 failover is completed.
+ * GRACEFULLY_REBOOTING - FAILING_GRACEFULLY_REBOOTING_NODE
+ *						  Node has ordered reboot and waits for the rebooted
+ *						  node to join the cluster again.
  * JOINING_ASSIGNING_WL - JOINING_ASSIGNING_WORKLOAD
  *                        Node has ordered all applications to assign workload
  *                        to all its SUs which currently have no workload and
@@ -155,6 +171,12 @@
  *      [foreach SG in application ]
  *      [foreach SU in SG where the SU is hosted on current node]
  *      [foreach comp in such an SU]indicate that the node has left the cluster
+ * A10- 
+ * A11- [foreach SG in cluster]failover node
+ * A12- reboot node
+ * A13- restart SU
+ * A14- failover SU
+ * A15- failover node
  * 
  * 1.4 Guards
  * ==========
@@ -163,6 +185,8 @@
  * C3 -
  * C4 - No applications are in ACSM state == STARTING_SGS
  * C5 - All applications have ACSM state == WORKLOAD_ASSIGNED
+ * C6 - Specified number of SU restarts have been done.
+ * C7 - Specified number of SU failover actions have been done.
  */ 
 
 #include <stdlib.h>
@@ -223,10 +247,6 @@ static void node_acsm_enter_failing_over (struct amf_node *node)
 	}
 }
 
-/**
- * 
- * @param node
- */
 static void failover_all_sg_on_node (amf_node_t *node)
 {
 	amf_application_t *app;
@@ -305,11 +325,6 @@ static void node_acsm_enter_idle (amf_node_t *node)
 	node->acsm_state =  node->history_state;
 }
 
-/**
- * 
- * @param node
- * @param app
- */
 static void node_acsm_enter_joining_assigning_workload (struct amf_node *node, 
 	struct amf_application *app)
 {
@@ -365,7 +380,8 @@ void amf_node_leave (struct amf_node *node)
 }
 
 /**
- * 
+ * This function handles a detected error that by a pre-analysis executed
+ * elsewhere has been decided to be recovered by a node fail over.
  * @param node
  */
 void amf_node_failover (struct amf_node *node)
@@ -409,7 +425,11 @@ void amf_node_failfast (struct amf_node *node)
 }
 
 /**
- * 
+ * This event is a request to restart a component which has been escalated,
+ * because the component has already been restarted the number of times
+ * specified by the configuration. 
+ * This function evaluates which recovery measure shall now be
+ * taken and initiates the action which result from the evaluation.
  * @param node
  * @param comp
  */
@@ -463,8 +483,12 @@ void amf_node_comp_restart_req (struct amf_node *node, struct amf_comp *comp)
 }
 
 /**
- * 
+ * This event is a request to failover the specified component. 
+ * This function evaluates which recovery measure shall actually be
+ * taken considering the escalation policy and initiates the action
+ * which result from the evaluation.
  * @param node
+ * @param comp
  */
 void amf_node_comp_failover_req (amf_node_t *node, amf_comp_t *comp)
 {
@@ -583,7 +607,7 @@ void amf_node_application_started (struct amf_node *node,
  * This event indicates that an application has been assigned workload.
  * 
  * @param node
- * @param application which has been assigned workload
+ * @param app - Application which has been assigned workload
  */
 void amf_node_application_workload_assigned (struct amf_node *node, 
 	struct amf_application *app)
@@ -643,7 +667,6 @@ void amf_node_sg_failed_over (struct amf_node *node, struct amf_sg *sg_in)
 			openais_exit_error (AIS_DONE_FATAL_ERR);
 			break;
 	}
-
 }
 
 /******************************************************************************
@@ -655,11 +678,11 @@ void amf_node_init (void)
 	log_init ("AMF");
 }
 
+
 /**
  * Node constructor
- * @param loc
  * @param cluster
- * @param node
+ * @param name - RDN of node
  */
 struct amf_node *amf_node_new (struct amf_cluster *cluster, char *name) {
 	struct amf_node *node = amf_calloc (1, sizeof (struct amf_node));

+ 0 - 1
exec/totemip.c

@@ -163,7 +163,6 @@ int totemip_compare(const void *a, const void *b)
 		}
 	} else
 	if (family == AF_INET6) {
-		int res;
 		/*
 		 * Compare 16 bits at a time the ipv6 address
 		 */

+ 2 - 2
lib/cfg.c

@@ -323,9 +323,9 @@ openais_cfg_finalize (
 
 	pthread_mutex_unlock (&cfg_instance->dispatch_mutex);
 
-	pthread_mutex_destory (&cfg_instance->response_mutex);
+	pthread_mutex_destroy (&cfg_instance->response_mutex);
 
-	pthread_mutex_destory (&cfg_instance->dispatch_mutex);
+	pthread_mutex_destroy (&cfg_instance->dispatch_mutex);
 
 	saHandleDestroy (&cfg_hdb, cfg_handle);