Hi Thang, OK. No more comment from me. Thanks.
Best Regards, ThuanTr -----Original Message----- From: Thang Nguyen <thang.d.ngu...@dektech.com.au> Sent: Thursday, July 11, 2019 2:09 PM To: 'Tran Thuan' <thuan.t...@dektech.com.au>; gary....@dektech.com.au; minh.c...@dektech.com.au; hans.nordeb...@ericsson.com Cc: opensaf-devel@lists.sourceforge.net Subject: RE: [devel] [PATCH 1/1] amf: realign sg if si_dep_state of si in FAILOVER_UNDER_PROGRESS [#3054] Hi Thuan, Thanks for your review. I tested with your suggestion but it failed for another test case. B.R /Thang -----Original Message----- From: Tran Thuan <thuan.t...@dektech.com.au> Sent: Thursday, July 11, 2019 11:06 AM To: 'thang.d.nguyen' <thang.d.ngu...@dektech.com.au>; gary....@dektech.com.au; minh.c...@dektech.com.au; hans.nordeb...@ericsson.com Cc: opensaf-devel@lists.sourceforge.net Subject: RE: [devel] [PATCH 1/1] amf: realign sg if si_dep_state of si in FAILOVER_UNDER_PROGRESS [#3054] Hi Thang, See my comment [Thuan] inline. Best Regards, ThuanTr -----Original Message----- From: thang.d.nguyen <thang.d.ngu...@dektech.com.au> Sent: Tuesday, July 2, 2019 10:21 PM To: gary....@dektech.com.au; minh.c...@dektech.com.au; hans.nordeb...@ericsson.com Cc: opensaf-devel@lists.sourceforge.net Subject: [devel] [PATCH 1/1] amf: realign sg if si_dep_state of si in FAILOVER_UNDER_PROGRESS [#3054] With SI dependency, when failover happen the failover is processed on SU had sponsor SI first. It also update the si_dep_state of dependent SI to FAILOVER_UNDER_PROGRESS. Then failover is processed on SU had dependent SI. But failover is deferred as sponsors role failover is under going. Amfd crashes when the SU had dependent SI was instantiated on standy node while the assignment ACTIVE sponsor SI for SU on ACTIVE node still assigning. --- src/amf/amfd/sg.cc | 13 +++++++++++++ src/amf/amfd/sg.h | 1 + src/amf/amfd/sgproc.cc | 6 +++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/amf/amfd/sg.cc b/src/amf/amfd/sg.cc index 09f8f31..c815489 100644 --- a/src/amf/amfd/sg.cc +++ b/src/amf/amfd/sg.cc @@ -2345,6 +2345,19 @@ bool AVD_SG::any_assignment_excessive() { return pending; } +bool AVD_SG::any_failover_under_progress() { + bool pending = false; + TRACE_ENTER2("SG:'%s'", name.c_str()); + for (const auto &si : list_of_si) { + if (si->si_dep_state == AVD_SI_FAILOVER_UNDER_PROGRESS) { + pending = true; + break; + } + } + TRACE_LEAVE(); + return pending; +} + /* * Going through all SU of this SG, if any SU has over assigned, * reboot the node that hosts the SU. diff --git a/src/amf/amfd/sg.h b/src/amf/amfd/sg.h index 55e7dbe..147429b 100644 --- a/src/amf/amfd/sg.h +++ b/src/amf/amfd/sg.h @@ -441,6 +441,7 @@ class AVD_SG { bool any_assignment_absent(); bool any_assignment_assigned(); bool any_assignment_excessive(); + bool any_failover_under_progress(); void failover_absent_assignment(); bool ng_using_saAmfSGAdminState; bool headless_validation; diff --git a/src/amf/amfd/sgproc.cc b/src/amf/amfd/sgproc.cc index 7c8d9a5..ebf11c8 100644 --- a/src/amf/amfd/sgproc.cc +++ b/src/amf/amfd/sgproc.cc @@ -1007,7 +1007,11 @@ void avd_su_oper_state_evh(AVD_CL_CB *cb, AVD_EVT *evt) { */ if (su->sg_of_su->any_assignment_in_progress() == false && su->sg_of_su->any_assignment_absent() == false) { - su->sg_of_su->set_fsm_state(AVD_SG_FSM_STABLE); + if (su->sg_of_su->any_failover_under_progress() == false) { + su->sg_of_su->set_fsm_state(AVD_SG_FSM_STABLE); + } else { + su->sg_of_su->set_fsm_state(AVD_SG_FSM_SG_REALIGN); + } [Thuan] just need add one more condition to set fsm state STABLE. if (su->sg_of_su->any_assignment_in_progress() == false && su->sg_of_su->any_assignment_absent() == false && su->sg_of_su->any_failover_under_progress() == false) { su->sg_of_su->set_fsm_state(AVD_SG_FSM_STABLE); } [Thuan] I have tested this with your TC, it works. if (su->sg_of_su->sg_ncs_spec == true) { if (su->saAmfSUAdminState == SA_AMF_ADMIN_UNLOCKED) { -- 2.7.4 _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel