Hi Minh,

Please find one query inline with [Praveen].
Thanks,
Praveen
On 28-Jul-17 7:44 AM, Minh Chau wrote:
Symtomp is similar to #2477, this patch fixes for case of
2 STANDBY assignment for same SI
---
  src/amf/amfd/si.cc    | 14 ++++++++++++++
  src/amf/amfd/si.h     |  1 +
  src/amf/amfd/siass.cc |  6 ++----
  3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/amf/amfd/si.cc b/src/amf/amfd/si.cc
index 3f76c1476..27245339c 100644
--- a/src/amf/amfd/si.cc
+++ b/src/amf/amfd/si.cc
@@ -1594,6 +1594,20 @@ const AVD_SIRANKEDSU *AVD_SI::get_si_ranked_su(
return sirankedsu;
  }
+/*
+ * @brief Count number of SUSI assignment that are assigned to this SI
+ *        with specified HA state
+ * @param [in] @ha: HA state
+ * @return: number of SUSI assignment
+ */
+uint32_t AVD_SI::count_sisu_with(SaAmfHAStateT ha) {
+  uint32_t count = 0;
+  for (AVD_SU_SI_REL *sisu = list_of_sisu; sisu != nullptr;
+      sisu = sisu->si_next) {
+    if (sisu->state == ha) count++;
+  }
+  return count;
+}
/*
   * @brief Update alarm_sent by new value of @alarm_state,
diff --git a/src/amf/amfd/si.h b/src/amf/amfd/si.h
index 4f8dc5718..af14363b6 100644
--- a/src/amf/amfd/si.h
+++ b/src/amf/amfd/si.h
@@ -152,6 +152,7 @@ class AVD_SI {
    const AVD_SIRANKEDSU *get_si_ranked_su(const std::string &su_name) const;
    bool is_active() const;
    SaAisErrorT si_swap_validate();
+  uint32_t count_sisu_with(SaAmfHAStateT ha);
private:
    bool is_assigned() const { return list_of_sisu ? true : false; }
diff --git a/src/amf/amfd/siass.cc b/src/amf/amfd/siass.cc
index d14d279dc..267c55c07 100644
--- a/src/amf/amfd/siass.cc
+++ b/src/amf/amfd/siass.cc
@@ -351,11 +351,9 @@ bool avd_susi_validate_absent_assignment(AVD_SU *su, 
AVD_SI *si,
        goto done;
    }
    // No need to create absent SUSI assignment for the 2N SI that already has
-  // ACTIVE SUSI
+  // the same @imm_ha_state SUSI
    if (su->sg_of_su->sg_redundancy_model == SA_AMF_2N_REDUNDANCY_MODEL) {
-    if (si->list_of_sisu != nullptr &&
-        si->list_of_sisu->state == SA_AMF_HA_ACTIVE &&
-        imm_ha_state == SA_AMF_HA_ACTIVE)
+    if (si->count_sisu_with(imm_ha_state) > 0)
[Praveen] Ticket is raised for 2 standby case and earliar fix was for 2 acitve case. This if block now does not check HA state. What will happen in the case of quiesced state? We can have two quiesced state in case of faults when a SU faults when it is becoming active in switchover situation and amf sends quiesced state to this faulted active SU.


        goto done;
    }

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to