During standby SU restarts, active SU is failover. The standby SU
need re-assignment standby then take over active assignment.
This is to correct the issue in the ticket #3207.
---
src/amf/amfnd/comp.cc | 3 +--
src/amf/amfnd/susm.cc | 55 +++++++++++++------------------------------
2 files changed, 17 insertions(+), 41 deletions(-)
diff --git a/src/amf/amfnd/comp.cc b/src/amf/amfnd/comp.cc
index f1e33c372..d805346bb 100644
--- a/src/amf/amfnd/comp.cc
+++ b/src/amf/amfnd/comp.cc
@@ -1083,8 +1083,7 @@ uint32_t avnd_comp_csi_assign(AVND_CB *cb, AVND_COMP
*comp,
if (curr_csi->curr_assign_state ==
AVND_COMP_CSI_ASSIGN_STATE_UNASSIGNED &&
curr_csi->prv_assign_state ==
- AVND_COMP_CSI_ASSIGN_STATE_UNASSIGNED &&
- !m_AVND_SU_IS_RESTART(comp->su)) {
+ AVND_COMP_CSI_ASSIGN_STATE_UNASSIGNED) {
// Mark suspending_assignment for all unassigned csi(s) which are
// going to be assigned to *curr_csi->comp*
for (t_csi = m_AVND_CSI_REC_FROM_COMP_DLL_NODE_GET(
diff --git a/src/amf/amfnd/susm.cc b/src/amf/amfnd/susm.cc
index d8ef66ea2..80b35ea8f 100644
--- a/src/amf/amfnd/susm.cc
+++ b/src/amf/amfnd/susm.cc
@@ -306,18 +306,15 @@ uint32_t avnd_su_siq_prc(AVND_CB *cb, AVND_SU *su) {
return rc;
}
+ /* unlink the buffered msg from the queue */
+ ncs_db_link_list_delink(&su->siq, &siq->su_dll_node);
+
/* initiate si asignment / removal */
rc = avnd_su_si_msg_prc(cb, su, &siq->info);
- // Siq will used to su-si respond later
- // in case modify SU-SI during SURestart
- if ((siq->info.msg_act != AVSV_SUSI_ACT_MOD) ||
- !m_AVND_SU_IS_RESTART(su)) {
- /* unlink the buffered msg from the queue */
- ncs_db_link_list_delink(&su->siq, &siq->su_dll_node);
- /* delete the buffered msg */
- avnd_su_siq_rec_del(cb, su, siq);
- }
+ /* delete the buffered msg */
+ avnd_su_siq_rec_del(cb, su, siq);
+
TRACE_LEAVE2("%u", rc);
return rc;
}
@@ -1134,7 +1131,6 @@ static bool container_contained_shutdown(const AVND_SU
*su) {
uint32_t avnd_su_si_oper_done(AVND_CB *cb, AVND_SU *su, AVND_SU_SI_REC *si) {
AVND_SU_SI_REC *curr_si = 0;
AVND_COMP_CSI_REC *curr_csi = 0, *t_csi = 0;
- AVND_SU_SIQ_REC *siq = 0;
uint32_t rc = NCSCC_RC_SUCCESS;
bool opr_done;
@@ -1212,18 +1208,6 @@ uint32_t avnd_su_si_oper_done(AVND_CB *cb, AVND_SU *su,
AVND_SU_SI_REC *si) {
if (NCSCC_RC_SUCCESS != rc) goto done;
}
- // Modify event during SURestart should be respond
- siq = reinterpret_cast<AVND_SU_SIQ_REC *>(m_NCS_DBLIST_FIND_LAST(&su->siq));
- if (siq && (siq->info.msg_act == AVSV_SUSI_ACT_MOD) &&
- m_AVND_SU_IS_RESTART(su)) {
- ncs_db_link_list_delink(&su->siq, &siq->su_dll_node);
- /* delete the buffered msg */
- avnd_su_siq_rec_del(avnd_cb, su, siq);
- rc = avnd_di_susi_resp_send(cb, su,
- m_AVND_SU_IS_ALL_SI(su) ? nullptr : si);
- if (NCSCC_RC_SUCCESS != rc) goto done;
- }
-
if (si && (cb->term_state == AVND_TERM_STATE_OPENSAF_SHUTDOWN_INITIATED)) {
(void)avnd_evt_last_step_term_evh(cb, nullptr);
} else if (si &&
@@ -1713,23 +1697,16 @@ static uint32_t
pi_su_instantiating_to_instantiated(AVND_SU *su) {
/* reset the su failed flag & set the oper state to enabled */
m_AVND_SU_OPER_STATE_SET(su, SA_AMF_OPERATIONAL_ENABLED);
TRACE("Setting the Oper state to Enabled");
-
- AVND_SU_SIQ_REC *siq = 0;
- siq = reinterpret_cast<AVND_SU_SIQ_REC
*>(m_NCS_DBLIST_FIND_LAST(&su->siq));
- if (siq && (siq->info.msg_act == AVSV_SUSI_ACT_MOD)) {
- rc = avnd_su_siq_prc(avnd_cb, su);
- } else {
- /*
- * reassign all the sis...
- * it's possible that the si was never assigned. send su-oper
- * enable msg instead.
- */
- if (su->si_list.n_nodes)
- rc = avnd_su_si_reassign(avnd_cb, su);
- else {
- rc = avnd_di_oper_send(avnd_cb, su, 0);
- reset_suRestart_flag(su);
- }
+ /*
+ * reassign all the sis...
+ * it's possible that the si was never assigned. send su-oper
+ * enable msg instead.
+ */
+ if (su->si_list.n_nodes)
+ rc = avnd_su_si_reassign(avnd_cb, su);
+ else {
+ rc = avnd_di_oper_send(avnd_cb, su, 0);
+ reset_suRestart_flag(su);
}
su->admin_op_Id = static_cast<SaAmfAdminOperationIdT>(0);
} else {
--
2.17.1
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel