osaf/services/saf/amf/amfd/cluster.cc | 10 +++++ osaf/services/saf/amf/amfd/include/sg.h | 1 + osaf/services/saf/amf/amfd/sg.cc | 56 +++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 0 deletions(-)
si_dep is configured in cluster and it could be broken due to sponsor SI get unassigned during headless. When SC comes back, the current implementation of non-headless starts tolerance timer for dependent SI before removes it. The issue is the timer dependent SI now has been tolerated larger than configuration since sponsor SI had been unassigned during headless. Since AMF can not start another tolerance timer once SC come back, so the patch has removed the dependent SI once AMF scans through the unassigned sponsor SI. This is limitation for now. Ideally, AMF can figure how long tolerating time is left for dependent SI since sponsor SI actually get unassigned during headless, so that the real tolerance timer can be started accurately. diff --git a/osaf/services/saf/amf/amfd/cluster.cc b/osaf/services/saf/amf/amfd/cluster.cc --- a/osaf/services/saf/amf/amfd/cluster.cc +++ b/osaf/services/saf/amf/amfd/cluster.cc @@ -98,6 +98,16 @@ void avd_cluster_tmr_init_evh(AVD_CL_CB i_sg->realign(cb, i_sg); } + /* The SI Dependency could be broken due to failover or instantiation/ + * termination failure during headless. + * adjust_delayed_sidep() removes SI(s) assignment which has any + * unassigned sponsored SI. + * + */ + if (cb->scs_absence_max_duration > 0) { + adjust_delayed_sidep(cb); + } + if (cb->scs_absence_max_duration > 0) { TRACE("check if any SU is auto repair enabled"); diff --git a/osaf/services/saf/amf/amfd/include/sg.h b/osaf/services/saf/amf/amfd/include/sg.h --- a/osaf/services/saf/amf/amfd/include/sg.h +++ b/osaf/services/saf/amf/amfd/include/sg.h @@ -606,5 +606,6 @@ extern void avd_sg_adjust_config(AVD_SG extern uint32_t sg_instantiated_su_count(const AVD_SG *sg); extern bool sg_stable_after_lock_in_or_unlock_in(AVD_SG *sg); extern void process_su_si_response_for_ng(AVD_SU *su, SaAisErrorT res); +extern void adjust_delayed_sidep(AVD_CL_CB *cb); #endif diff --git a/osaf/services/saf/amf/amfd/sg.cc b/osaf/services/saf/amf/amfd/sg.cc --- a/osaf/services/saf/amf/amfd/sg.cc +++ b/osaf/services/saf/amf/amfd/sg.cc @@ -2000,6 +2000,62 @@ done: return rc; } +/** + * @Brief Check if SI Dependency relations between SIs are still valid + * as cluster has just being came from headless. The dependent SIs + * which have any unassigned sponsor SI will remove the assignments. + * + * @param None + * @Return None +*/ +void adjust_delayed_sidep(AVD_CL_CB *cb) +{ + AVD_SU_SI_REL *curr_susi; + TRACE_ENTER(); + + // Searching for the dependent SIs which's sponsored SI(s) + // had removed assignment in headless. + // For next cursive level of dependency, the dependent SI + // will be removed after tolerant timer expires + + for (std::map<std::string, AVD_SG*>::const_iterator it = sg_db->begin(); + it != sg_db->end(); it++) { + AVD_SG *i_sg = it->second; + if (i_sg->list_of_su.empty() || (i_sg->sg_ncs_spec == true)) { + continue; + } + for (const auto& si : i_sg->list_of_si) { + if (si->list_of_sisu && + si->saAmfSIAssignmentState != SA_AMF_ASSIGNMENT_UNASSIGNED) { + bool any_unassign_spsi = false; + AVD_SPONS_SI_NODE *spsi_node = si->spons_si_list; + for(; spsi_node != nullptr && !any_unassign_spsi; + spsi_node = spsi_node->next) { + // if any of sponsored si has no assignment + // @si will remove its all assignments + if ((spsi_node->si->curr_standby_assignments() + + spsi_node->si->curr_active_assignments()) == 0) { + // remove all sisu of @si + for(curr_susi = si->list_of_sisu; curr_susi; + curr_susi = curr_susi->si_next) { + if (curr_susi->fsm == AVD_SU_SI_STATE_ASGND) { + LOG_NO("Remove '%s' from '%s' due to sponsor SI %s is unassigned", + curr_susi->si->name.value, curr_susi->su->name.value, + spsi_node->si->name.value); + avd_susi_del_send(curr_susi); + avd_sg_su_oper_list_add(cb, curr_susi->su, false); + i_sg->set_fsm_state(AVD_SG_FSM_SG_REALIGN); + any_unassign_spsi = true; + } + } + } + } + } + } + } + + TRACE_LEAVE(); +} AVD_SU* AVD_SG::first_su() { ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel