- improves the inclosed dokumentation in amfsu,amfsg and amnode.

- improves error handling  caused by the INSTANTIATE or CLEANUP  command
  while recovering  with component_restart or su_restart


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1347 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Lon Hohberger 2007-01-18 07:39:42 +00:00
parent 79df855070
commit 77668738f6
6 changed files with 1557 additions and 900 deletions

View File

@ -1575,12 +1575,13 @@ static void message_handler_req_exec_amf_clc_cleanup_completed (
{
struct req_exec_amf_clc_cleanup_completed *req_exec = message;
amf_comp_t *comp;
ENTER ("");
if (scsm.state != NORMAL_OPERATION) {
return;
}
comp = amf_comp_find (amf_cluster, &req_exec->compName);
ENTER ("%s",comp->name.value);
if (comp == NULL) {
log_printf (LOG_ERR, "Error: '%s' not found", req_exec->compName.value);
return;

View File

@ -145,7 +145,7 @@ typedef enum {
SG_AC_RemovingAssignment,
SG_AC_AssigningActiveworkload,
SG_AC_AssigningAutoAdjust,
SG_AC_AssigningStandBy,
SG_AC_AssigningWorkload,
SG_AC_WaitingAfterOperationFailed,
SG_AC_RemovingStandbyAssignments
} sg_avail_control_state_t;
@ -238,6 +238,12 @@ typedef struct amf_fifo {
uint8_t data[];
} amf_fifo_t;
typedef enum {
AMF_PRESENCE_TERMINATION_FAILED_REBOOT =
SA_AMF_PRESENCE_TERMINATION_FAILED + 1
} AmfPresenceStateT;
typedef struct amf_cluster {
/* Configuration Attributes */
SaNameT name;

View File

@ -644,7 +644,6 @@ static void mcast_cleanup_completion_event (void *context)
(struct clc_command_run_data *)context;
struct req_exec_amf_clc_cleanup_completed req;
struct iovec iovec;
req.header.size = sizeof (struct req_exec_amf_clc_cleanup_completed);
req.header.id = SERVICE_ID_MAKE (AMF_SERVICE,
MESSAGE_REQ_EXEC_AMF_CLC_CLEANUP_COMPLETED);
@ -1443,9 +1442,12 @@ void amf_comp_cleanup_failed_completed (amf_comp_t *comp)
*/
void amf_comp_cleanup_completed (struct amf_comp *comp)
{
TRACE2("Exec CLC cleanup completed for '%s'", comp->name.value);
TRACE2("Exec CLC cleanup completed for '%s' %d", comp->name.value,
comp->saAmfCompPresenceState);
stop_component_cleanup_timer (comp);
/* Set all CSI's confirmed HA state to unknown */
amf_comp_foreach_csi_assignment (comp, clear_ha_state);
@ -1453,6 +1455,9 @@ void amf_comp_cleanup_completed (struct amf_comp *comp)
if (comp->saAmfCompPresenceState == SA_AMF_PRESENCE_RESTARTING) {
amf_comp_instantiate (comp);
} else if (comp->saAmfCompPresenceState ==
SA_AMF_PRESENCE_TERMINATION_FAILED) {
comp_presence_state_set (comp, SA_AMF_PRESENCE_TERMINATION_FAILED);
} else {
comp_presence_state_set (comp, SA_AMF_PRESENCE_UNINSTANTIATED);
}
@ -1631,7 +1636,6 @@ void amf_comp_instantiate_tmo_event (struct amf_comp *comp)
amf_comp_operational_state_set (comp, SA_AMF_OPERATIONAL_DISABLED);
comp_presence_state_set (comp, SA_AMF_PRESENCE_INSTANTIATION_FAILED);
break;
case SA_AMF_PRESENCE_INSTANTIATED:
assert (comp->instantiate_timeout_handle == 0);
@ -1923,7 +1927,9 @@ void amf_comp_terminate (struct amf_comp *comp)
if (amf_comp_is_error_suspected(comp)) {
clc_interfaces[comp->comptype]->cleanup (comp);
} else {
clc_interfaces[comp->comptype]->terminate (comp);
/*TODO temination implementation */
/*clc_interfaces[comp->comptype]->terminate (comp);*/
clc_interfaces[comp->comptype]->cleanup (comp);
}
}
}
@ -1968,7 +1974,7 @@ SaAisErrorT amf_comp_hastate_get (
return SA_AIS_OK;
}
return SA_AIS_ERR_INVALID_PARAM;
return SA_AIS_ERR_NOT_EXIST;
}
/**

View File

@ -499,11 +499,7 @@ void amf_node_comp_failover_req (amf_node_t *node, amf_comp_t *comp)
if (comp->su->saAmfSUFailover) {
/* SU failover */
amf_sg_failover_su_req (comp->su->sg,comp->su, node);
} else {
/* TODO: component failover */
assert (0);
}
}
break;
case NODE_ACSM_IDLE_ESCALLATION_LEVEL_3:
if (comp->su->su_failover_cnt < node->saAmfNodeSuFailoverMax) {
@ -511,13 +507,10 @@ void amf_node_comp_failover_req (amf_node_t *node, amf_comp_t *comp)
/* SU failover */
amf_sg_failover_su_req (comp->su->sg,comp->su, node);
} else {
/* TODO: component failover */
assert (0);
}
}
} else {
node->history_state = NODE_ACSM_IDLE_ESCALLATION_LEVEL_0;
amf_node_failover (node);
amf_node_failover (node);
}
break;
default:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff