osaf/services/saf/avsv/avnd/avnd_clc.c | 3 ++-
osaf/services/saf/avsv/avnd/avnd_susm.c | 28 ++++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 1 deletions(-)
In case of NPI SU, failed component is cleaned up when AMFD sends quiesced HA
state to AMFND.
In this issue when SU is still instantiating, one instantiated component failed
with suFailover recovery.
When AMFD sends quiesced HA state, AMFND moves SU to terminating state without
cleaning up failed component.
When another component gets fully instantiated, SU FSM should trigger
termination of healthy components and
cleanup of failed components. This patch ensures that if SU moves from
Instantiating to Terminating state due to suFailover then after
instantiation of all the components SU FSM will terminate or cleanup all
components and will, thus, finish quiesced assignments.
diff --git a/osaf/services/saf/avsv/avnd/avnd_clc.c
b/osaf/services/saf/avsv/avnd/avnd_clc.c
--- a/osaf/services/saf/avsv/avnd/avnd_clc.c
+++ b/osaf/services/saf/avsv/avnd/avnd_clc.c
@@ -2028,7 +2028,8 @@ uint32_t avnd_comp_clc_terming_cleansucc
}
/* TODO(hafe) needs to be changed when SU failover is implemented */
- if (m_AVND_COMP_IS_FAILED(comp) && m_AVND_SU_IS_FAILED(comp->su)) {
+ if (m_AVND_COMP_IS_FAILED(comp) && m_AVND_SU_IS_FAILED(comp->su) &&
+ m_AVND_SU_IS_PREINSTANTIABLE(comp->su)) {
/* request director to orchestrate component failover */
rc = avnd_di_oper_send(cb, comp->su, SA_AMF_COMPONENT_FAILOVER);
}
diff --git a/osaf/services/saf/avsv/avnd/avnd_susm.c
b/osaf/services/saf/avsv/avnd/avnd_susm.c
--- a/osaf/services/saf/avsv/avnd/avnd_susm.c
+++ b/osaf/services/saf/avsv/avnd/avnd_susm.c
@@ -2118,6 +2118,8 @@ uint32_t avnd_su_pres_inst_compterming_h
uint32_t avnd_su_pres_terming_compinst_hdler(AVND_CB *cb, AVND_SU *su,
AVND_COMP *comp)
{
bool is;
+ AVND_SU_SI_REC *si = 0;
+ AVND_COMP_CSI_REC *csi = 0;
uint32_t rc = NCSCC_RC_SUCCESS;
char *compname = comp ? (char*)comp->name.value : "none";
TRACE_ENTER2("ComponentInstantiate event in the terminating state:'%s'
: '%s'",
@@ -2135,6 +2137,32 @@ uint32_t avnd_su_pres_terming_compinst_h
avnd_su_pres_state_set(su,
SA_AMF_PRESENCE_INSTANTIATED);
}
}
+ else {
+ TRACE("NPI SU:'%s'",su->name.value);
+ if (!m_AVND_SU_IS_FAILED(su) || (cb->oper_state ==
SA_AMF_OPERATIONAL_DISABLED))
+ goto done;
+ si = (AVND_SU_SI_REC *)m_NCS_DBLIST_FIND_FIRST(&su->si_list);
+ osafassert(si);
+ /* Clean up/terminate components when they move to other than
instantiating state. */
+ for (csi = (AVND_COMP_CSI_REC
*)m_NCS_DBLIST_FIND_FIRST(&si->csi_list);
+ csi; csi = (AVND_COMP_CSI_REC
*)m_NCS_DBLIST_FIND_NEXT(&csi->si_dll_node)) {
+ if (m_AVND_COMP_PRES_STATE_IS_INSTANTIATING(csi->comp))
+ goto done;
+ }
+
+ csi = (AVND_COMP_CSI_REC
*)m_NCS_DBLIST_FIND_LAST(&si->csi_list);
+ if (m_AVND_SU_SI_CURR_ASSIGN_STATE_IS_REMOVING(si))
+ m_AVND_COMP_CSI_CURR_ASSIGN_STATE_SET(csi,
AVND_COMP_CSI_ASSIGN_STATE_REMOVING);
+ else
+ m_AVND_COMP_CSI_CURR_ASSIGN_STATE_SET(csi,
AVND_COMP_CSI_ASSIGN_STATE_ASSIGNING);
+ m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, csi,
AVND_CKPT_COMP_CSI_CURR_ASSIGN_STATE);
+
+ rc = avnd_comp_clc_fsm_run(cb, csi->comp,
(m_AVND_COMP_IS_FAILED(csi->comp)) ?
+ AVND_COMP_CLC_PRES_FSM_EV_CLEANUP :
AVND_COMP_CLC_PRES_FSM_EV_TERM);
+ if (NCSCC_RC_SUCCESS != rc)
+ LOG_ER("Termination of '%s'
failed",csi->comp->name.value);
+ }
+done:
TRACE_LEAVE2("%u", rc);
return rc;
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel