On 31-Mar-14 4:24 PM, Hans Feldt wrote: > Hi, > > Nack for this version, I think we need todo some iterations of this. > > I have a slightly similar patch. I think this one is strange in that the > response I sent if the su_switch state is STABLE. No logic in that... > > Also the response code should be refactored into its own function e.g. > "complete_siswap" > > Besides the patch does not handle SUFailover during SI-swap. The floated patch is applicable for all the branches. For default and 4.4 branch, this extra patch to handle su-failover is also required:
diff --git a/osaf/services/saf/amf/amfd/sgproc.cc b/osaf/services/saf/amf/amfd/sgproc.cc --- a/osaf/services/saf/amf/amfd/sgproc.cc +++ b/osaf/services/saf/amf/amfd/sgproc.cc @@ -334,7 +334,14 @@ static uint32_t sg_su_failover_func(AVD_ deleting the SUSI. */ avd_si_dec_curr_act_ass(susi->si); } + + if (susi->si->invocation != 0) { + avd_saImmOiAdminOperationResult(avd_cb->immOiHandle, + susi->si->invocation, SA_AIS_OK); + susi->si->invocation = 0; + } } + su->sg_of_su->node_fail(avd_cb, su); avd_sg_su_asgn_del_util(avd_cb, su, true, false); } With this patch and floated one for #823, I have tested si-swap with sufailover in default branch. Thanks, Praveen > I would also prefer to fix 822 first since they are somewhat related. Will > share a patch for it. > > Thanks, > Hans > >> -----Original Message----- >> From: praveen.malv...@oracle.com [mailto:praveen.malv...@oracle.com] >> Sent: den 28 mars 2014 14:14 >> To: Hans Feldt; nagendr...@oracle.com; Hans Nordebäck >> Cc: opensaf-devel@lists.sourceforge.net >> Subject: [PATCH 1 of 1] amfd: return AIS_OK instead of BAD_OP for si-swap >> admin op [#823] >> >> osaf/services/saf/amf/amfd/sg_2n_fsm.cc | 23 +++++++++++++---------- >> 1 files changed, 13 insertions(+), 10 deletions(-) >> >> >> Problem: During si-swap if quiesced assignment faults, AMF returns >> BAD_OPERATION even though si-swap completes successfuly after recovery. >> >> Reason: During si-swap, AMF sends quiesced assignment to active SU. >> During quiesced assignments, one of the components faults. >> AMF performs cleanup of this failed component and perfroms the failover of >> assignments to standby SU. For the faulted SU assignments are deleted and >> when it gets sucessfully repaired, AMF assigns it with standby assignments. >> Thus si-swap operation eventually gets successful, but AMF returns >> BAD_OPERATION for the operation. >> >> Fix: Since AMF performs si-swap successfuly despite fault in quiesced state, >> this patch ensures that AMF returns SA_AIS_OK for the operation. >> >> diff --git a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc >> b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc >> --- a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc >> +++ b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc >> @@ -888,16 +888,6 @@ static uint32_t avd_sg_2n_su_fault_su_op >> if (su->sg_of_su->su_oper_list.su == su) { >> su_ha_state = avd_su_state_determine(su); >> if (su_ha_state == SA_AMF_HA_QUIESCED) { >> - if (su->su_switch == AVSV_SI_TOGGLE_SWITCH) { >> - AVD_SU_SI_REL *temp_susi; >> - for (temp_susi = su->list_of_susi; temp_susi != >> NULL; temp_susi = temp_susi->su_next) { >> - if (temp_susi->si->invocation != 0) { >> - >> avd_saImmOiAdminOperationResult(cb->immOiHandle, >> - >> temp_susi->si->invocation, SA_AIS_ERR_BAD_OPERATION); >> - temp_susi->si->invocation = 0; >> - } >> - } >> - } >> m_AVD_SET_SU_SWITCH(cb, su, AVSV_SI_TOGGLE_STABLE); >> } else if (su_ha_state == SA_AMF_HA_QUIESCING) { >> if (avd_sidep_si_dependency_exists_within_su(su)) { >> @@ -2095,6 +2085,19 @@ static uint32_t avd_sg_2n_susi_sucss_su_ >> } >> >> m_AVD_SET_SG_FSM(cb, (su->sg_of_su), >> AVD_SG_FSM_SG_REALIGN); >> + >> + if (su->su_switch == AVSV_SI_TOGGLE_STABLE) { >> + for (AVD_SU_SI_REL *temp_susi = >> su->list_of_susi; >> + temp_susi != NULL; >> + temp_susi = temp_susi->su_next) >> { >> + if (temp_susi->si->invocation != 0) { >> + >> avd_saImmOiAdminOperationResult(cb->immOiHandle, >> + >> temp_susi->si->invocation, SA_AIS_OK); >> + temp_susi->si->invocation = 0; >> + } >> + } >> + } >> + >> } >> } else if ((act == AVSV_SUSI_ACT_MOD) && (state == SA_AMF_HA_STANDBY) && >> (su->sg_of_su->su_oper_list.su == su)) { ------------------------------------------------------------------------------ _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel