osaf/services/saf/amf/amfnd/err.cc  |  13 ++++++++++---
 osaf/services/saf/amf/amfnd/susm.cc |  24 ++++++++++++++++++------
 2 files changed, 28 insertions(+), 9 deletions(-)


Problem: In case of npi su restart recovery, the condition to change su presence
state is not sufficient. If the component of the last csi in csi_list has been
restarted first due to componentRestart (before suRestart), amfnd can not find
any next csi and changes the su presence state to INSTANTIATED, this will miss
the restart for the rest of components.

Change: Mark all components are FAILED during suRestart, and su presence state
is changed only if all components are unmarked FAILED.

diff --git a/osaf/services/saf/amf/amfnd/err.cc 
b/osaf/services/saf/amf/amfnd/err.cc
--- a/osaf/services/saf/amf/amfnd/err.cc
+++ b/osaf/services/saf/amf/amfnd/err.cc
@@ -616,13 +616,20 @@ static uint32_t avnd_err_rcvr_comp_resta
 uint32_t avnd_err_rcvr_su_restart(AVND_CB *cb, AVND_SU *su, AVND_COMP 
*failed_comp)
 {
        uint32_t rc = NCSCC_RC_SUCCESS;
+       AVND_COMP *comp = NULL;
        TRACE_ENTER();
 
-       /* mark the su & comp failed */
+       /* mark the su & its all comps are failed if not marked */
        m_AVND_SU_FAILED_SET(su);
        m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, su, AVND_CKPT_SU_FLAG_CHANGE);
-       m_AVND_COMP_FAILED_SET(failed_comp);
-       m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, failed_comp, 
AVND_CKPT_COMP_FLAG_CHANGE);
+
+       for (comp = 
m_AVND_COMP_FROM_SU_DLL_NODE_GET(m_NCS_DBLIST_FIND_FIRST(&su->comp_list));
+            comp; comp = 
m_AVND_COMP_FROM_SU_DLL_NODE_GET(m_NCS_DBLIST_FIND_NEXT(&comp->su_dll_node))) {
+               if (!m_AVND_COMP_IS_FAILED(comp)) {
+                       m_AVND_COMP_FAILED_SET(comp);
+                       m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, comp, 
AVND_CKPT_COMP_FLAG_CHANGE);
+               }
+       }
 
        /* delete su current info */
        rc = avnd_su_curr_info_del(cb, su);
diff --git a/osaf/services/saf/amf/amfnd/susm.cc 
b/osaf/services/saf/amf/amfnd/susm.cc
--- a/osaf/services/saf/amf/amfnd/susm.cc
+++ b/osaf/services/saf/amf/amfnd/susm.cc
@@ -2638,12 +2638,24 @@ uint32_t avnd_su_pres_restart_compinst_h
                /* get the next csi */
                curr_csi = (AVND_COMP_CSI_REC 
*)m_NCS_DBLIST_FIND_NEXT(&curr_csi->si_dll_node);
                if (curr_csi) {
-                       /* we have another csi. trigger the comp fsm with 
RestartEv */
-                       rc = avnd_comp_clc_fsm_trigger(cb, curr_csi->comp, 
AVND_COMP_CLC_PRES_FSM_EV_RESTART);
-                       if (NCSCC_RC_SUCCESS != rc)
-                               goto done;
-               } else {
-                       /* => si assignment done */
+                       /* we have another csi. trigger the comp fsm with 
RestartEv if this comp is marked failed*/
+                       if (curr_csi->comp->pres == 
SA_AMF_PRESENCE_INSTANTIATED && m_AVND_COMP_IS_FAILED(curr_csi->comp)) {
+                               rc = avnd_comp_clc_fsm_trigger(cb, 
curr_csi->comp, AVND_COMP_CLC_PRES_FSM_EV_RESTART);
+                               if (NCSCC_RC_SUCCESS != rc)
+                                       goto done;
+                       }
+               }
+
+               /* check whether all comp's are instantiated */
+               for (curr_comp = 
m_AVND_COMP_FROM_SU_DLL_NODE_GET(m_NCS_DBLIST_FIND_FIRST(&su->comp_list));
+                    curr_comp && all_inst == true;
+                    curr_comp = 
m_AVND_COMP_FROM_SU_DLL_NODE_GET(m_NCS_DBLIST_FIND_NEXT(&curr_comp->su_dll_node)))
 {
+                       if (curr_comp->pres != SA_AMF_PRESENCE_INSTANTIATED || 
m_AVND_COMP_IS_FAILED(curr_comp))
+                               all_inst = false;
+               }
+
+               /* OK, all are instantiated */
+               if (all_inst == true) {
                        avnd_su_pres_state_set(su, 
SA_AMF_PRESENCE_INSTANTIATED);
                }
        }

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to