OK fine, ack. We can consider a change while refactoring the code base. Thanks, Hans
> -----Original Message----- > From: praveen malviya [mailto:[email protected]] > Sent: den 27 mars 2014 10:28 > To: Hans Feldt > Cc: Hans Feldt; [email protected]; Hans Nordebäck; > [email protected] > Subject: Re: [devel] [PATCH 1 of 1] amfnd: fix failover of NPI SU during SU > lock with fault [#820] > > It is consistent with other places NPI handling and > functions(susi_operation_in_progress(), etc) and it forced me to do so. > > Thanks > Praveen > > On 27-Mar-14 2:05 PM, Hans Feldt wrote: > > But would we not get the same result with more understandable logic? > > /Hans > > > > On 26 March 2014 08:10, praveen malviya <[email protected]> wrote: > >> On 26-Mar-14 11:51 AM, Hans Feldt wrote: > >>> Agree with the analysis but maybe not the solution. I think it would > >>> make more sense to check presence state UNINSTANTIATED for the > >>> components in the service unit. That is aligned with the spec > >>> description and is more understandable. > >>> > >>> What do you say? > >> In case of NPI SU a component receives only one CSI and only one SI will be > >> assigned to the whole SU. > >> Because of this one to one correspondence, both SU and componet FSMs are > >> triggered by picking CSIs from SI and not > >> by picking component from SUs (which is common in PI SU case). > >> So the fix have been kept aligned the same way. > >> > >> > >> Thanks, > >> Praveen > >> > >>> Thanks, > >>> Hans > >>> > >>> On 26 March 2014 06:13, <[email protected]> wrote: > >>>> osaf/services/saf/amf/amfnd/comp.cc | 2 +- > >>>> osaf/services/saf/amf/amfnd/include/avnd_su.h | 1 + > >>>> osaf/services/saf/amf/amfnd/susm.cc | 34 > >>>> ++++++++++++++++++++++++-- > >>>> 3 files changed, 33 insertions(+), 4 deletions(-) > >>>> > >>>> > >>>> Problem: During lock of NPI SU, AMF does not failover assignments > >>>> if a healthy component faults. > >>>> > >>>> Reason: During SU lock AMF sends quiesced assignment to NPI SU. > >>>> During quiesced assignment, when termination of one component is in > >>>> progress, > >>>> one of the healthy components faults. AMF performs cleanup of this failed > >>>> component and it moves the SU from TERMINATING to UNINSTANTIATED state > >>>> without waiting for the terminate command response of the first > >>>> component. > >>>> Thus SU moves to UNINSTANTIATED state when one of the components is still > >>>> in TERMINATING state. Now when first component responds for the > >>>> terminate > >>>> command, AMF sees SU in UNINSTANTIATED state and it does not take any > >>>> action. > >>>> > >>>> Fix: AMF should move NPI SU in UNINSTANTIATED state only when all the > >>>> CSIs > >>>> are moved to Removed/Assigned state. > >>>> > >>>> diff --git a/osaf/services/saf/amf/amfnd/comp.cc > >>>> b/osaf/services/saf/amf/amfnd/comp.cc > >>>> --- a/osaf/services/saf/amf/amfnd/comp.cc > >>>> +++ b/osaf/services/saf/amf/amfnd/comp.cc > >>>> @@ -1633,7 +1633,7 @@ done: > >>>> * > >>>> * @returns true/false > >>>> **/ > >>>> -static bool all_csis_in_removed_state(const AVND_SU *su) > >>>> +bool all_csis_in_removed_state(const AVND_SU *su) > >>>> { > >>>> AVND_COMP_CSI_REC *curr_csi; > >>>> AVND_SU_SI_REC *curr_si; > >>>> diff --git a/osaf/services/saf/amf/amfnd/include/avnd_su.h > >>>> b/osaf/services/saf/amf/amfnd/include/avnd_su.h > >>>> --- a/osaf/services/saf/amf/amfnd/include/avnd_su.h > >>>> +++ b/osaf/services/saf/amf/amfnd/include/avnd_su.h > >>>> @@ -406,5 +406,6 @@ extern struct avnd_su_si_rec *avnd_silis > >>>> extern void su_get_config_attributes(AVND_SU *su); > >>>> extern bool sufailover_in_progress(const AVND_SU *su); > >>>> extern bool sufailover_during_nodeswitchover(const AVND_SU *su); > >>>> +extern bool all_csis_in_removed_state(const AVND_SU *su); > >>>> > >>>> #endif > >>>> diff --git a/osaf/services/saf/amf/amfnd/susm.cc > >>>> b/osaf/services/saf/amf/amfnd/susm.cc > >>>> --- a/osaf/services/saf/amf/amfnd/susm.cc > >>>> +++ b/osaf/services/saf/amf/amfnd/susm.cc > >>>> @@ -2358,6 +2358,34 @@ uint32_t avnd_su_pres_terming_comptermfa > >>>> return rc; > >>>> } > >>>> > >>>> +/** > >>>> + * @brief Checks if all csis of all the sis in this su are in > >>>> removed state > >>>> + * > >>>> + * @param [in] cmp > >>>> + * > >>>> + * @returns true/false > >>>> + **/ > >>>> +static bool all_csis_in_assigned_state(const AVND_SU *su) > >>>> +{ > >>>> + AVND_COMP_CSI_REC *curr_csi; > >>>> + AVND_SU_SI_REC *curr_si; > >>>> + bool all_csi_removed = true; > >>>> + > >>>> + for (curr_si = (AVND_SU_SI_REC > >>>> *)m_NCS_DBLIST_FIND_FIRST(&su->si_list); > >>>> + curr_si && all_csi_removed; > >>>> + curr_si = (AVND_SU_SI_REC > >>>> *)m_NCS_DBLIST_FIND_NEXT(&curr_si->su_dll_node)) { > >>>> + for (curr_csi = (AVND_COMP_CSI_REC > >>>> *)m_NCS_DBLIST_FIND_FIRST(&curr_si->csi_list); > >>>> + curr_csi; curr_csi = (AVND_COMP_CSI_REC > >>>> *)m_NCS_DBLIST_FIND_NEXT(&curr_csi->si_dll_node)) { > >>>> + if > >>>> (!m_AVND_COMP_CSI_CURR_ASSIGN_STATE_IS_ASSIGNED(curr_csi)) { > >>>> + all_csi_removed= false; > >>>> + break; > >>>> + } > >>>> + } > >>>> + } > >>>> + > >>>> + return all_csi_removed; > >>>> +} > >>>> + > >>>> > >>>> /**************************************************************************** > >>>> Name : avnd_su_pres_terming_compuninst_hdler > >>>> > >>>> @@ -2468,10 +2496,10 @@ uint32_t avnd_su_pres_terming_compuninst > >>>> > >>>> AVND_COMP_CLC_PRES_FSM_EV_TERM); > >>>> if (NCSCC_RC_SUCCESS != rc) > >>>> goto done; > >>>> - } else { > >>>> - TRACE("SI Assignment done"); > >>>> + } > >>>> + > >>>> + if (all_csis_in_assigned_state(su) || > >>>> all_csis_in_removed_state(su)) > >>>> avnd_su_pres_state_set(su, > >>>> SA_AMF_PRESENCE_UNINSTANTIATED); > >>>> - } > >>>> } > >>>> > >>>> done: > >>>> > >>>> > >>>> ------------------------------------------------------------------------------ > >>>> Learn Graph Databases - Download FREE O'Reilly Book > >>>> "Graph Databases" is the definitive new guide to graph databases and > >>>> their > >>>> applications. Written by three acclaimed leaders in the field, > >>>> this first edition is now available. Download your free book today! > >>>> http://p.sf.net/sfu/13534_NeoTech > >>>> _______________________________________________ > >>>> Opensaf-devel mailing list > >>>> [email protected] > >>>> https://lists.sourceforge.net/lists/listinfo/opensaf-devel > >> ------------------------------------------------------------------------------ _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
