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);
+      }
     }
     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

Reply via email to