Hi Nagu Sorry I wasn’t very clear. I meant moving the 3 or so lines of LOG_NO from amfd_switch_stdby_actv() to where you call amfd_switch_stdby_actv(…, true).
Thanks Gary -----Original Message----- From: Nagendra Kumar <[email protected]> on behalf of Nagendra Kumar <[email protected]> Date: Friday, 10 March 2017 at 7:50 pm To: gary <[email protected]>, <[email protected]>, Praveen Malviya <[email protected]>, <[email protected]> Cc: <[email protected]> Subject: RE: [PATCH 1 of 1] amfd: handle TIMEOUT for avd_imm_applier_set [#2338] Hi Gary, Thank you for that. I also thought of the same thing, but since it is old log and provides a good information to the user about switchover, so I couldn't remove it. Thanks -Nagu > -----Original Message----- > From: Gary Lee [mailto:[email protected]] > Sent: 10 March 2017 06:26 > To: Nagendra Kumar; [email protected]; Praveen Malviya; > [email protected] > Cc: [email protected] > Subject: Re: [PATCH 1 of 1] amfd: handle TIMEOUT for avd_imm_applier_set > [#2338] > > HI Nagu > > Ack (reviewed + legacy tests run). > > Minor comment: perhaps it’s easier to take the log message out of > amfd_switch_stdby_actv() than add a parameter, since it’s only called from 2 > places. > > Thanks > Gary > > -----Original Message----- > From: <[email protected]> > Date: Wednesday, 8 March 2017 at 6:49 pm > To: <[email protected]>, <[email protected]>, > <[email protected]>, gary <[email protected]> > Cc: <[email protected]> > Subject: [PATCH 1 of 1] amfd: handle TIMEOUT for avd_imm_applier_set > [#2338] > > src/amf/amfd/role.cc | 22 ++++++++++++++++------ > src/amf/amfd/role.h | 2 +- > 2 files changed, 17 insertions(+), 7 deletions(-) > > > diff --git a/src/amf/amfd/role.cc b/src/amf/amfd/role.cc > --- a/src/amf/amfd/role.cc > +++ b/src/amf/amfd/role.cc > @@ -130,7 +130,7 @@ void avd_role_change_evh(AVD_CL_CB *cb, > (role == SA_AMF_HA_ACTIVE) && (cb->avail_state_avd == > SA_AMF_HA_STANDBY)) { > if (true == cb->swap_switch ) { > /* swap resulted Switch standby -> Active */ > - amfd_switch_stdby_actv(cb); > + amfd_switch_stdby_actv(cb, true); > status = NCSCC_RC_SUCCESS; > goto done; > } > @@ -803,6 +803,12 @@ try_again: > failed and amf reinitializes imm interface and > set applier in avd_imm_reinit_bg_thread. Imm may > return ERR_EXIST or INVALID_PARAM. */ > + TRACE("ERR_EXIST or INVALID_PARAM"); > + } else if (rc == SA_AIS_ERR_TIMEOUT) { > + /* Let it proceed as there may be a case of Immd not > + reachable i.e. node might have gone down during > + switchover. */ > + TRACE("SA_AIS_ERR_TIMEOUT"); > } else > osafassert(0); > } else > @@ -1147,6 +1153,7 @@ uint32_t amfd_switch_qsd_stdby(AVD_CL_CB > * change from standby to active in liue of SI SWAP Action > * > * Input: cb - AVD control block pointer. > + * Input: switch_flag - Whether switchover passed or failed. > * > * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. > * > @@ -1155,14 +1162,15 @@ uint32_t amfd_switch_qsd_stdby(AVD_CL_CB > * > > ************************************************************** > ************/ > > -uint32_t amfd_switch_stdby_actv(AVD_CL_CB *cb) > +uint32_t amfd_switch_stdby_actv(AVD_CL_CB *cb, bool switchover_flag) > { > uint32_t status = NCSCC_RC_SUCCESS; > SaAisErrorT rc; > > TRACE_ENTER(); > > - LOG_NO("Switching StandBy --> Active State"); > + if (switchover_flag) > + LOG_NO("Switching StandBy --> Active State"); > > /* > * Check whether Standby is in sync with Active. If yes then > @@ -1282,8 +1290,10 @@ uint32_t amfd_switch_stdby_actv(AVD_CL_C > } > } > > - LOG_NO("Controller switch over done"); > - saflog(LOG_NOTICE, amfSvcUsrName, "Controller switch over done > at %x", cb->node_id_avd); > + if (switchover_flag) { > + LOG_NO("Controller switch over done"); > + saflog(LOG_NOTICE, amfSvcUsrName, "Controller switch > over done at %x", cb->node_id_avd); > + } > > TRACE_LEAVE(); > return NCSCC_RC_SUCCESS; > @@ -1311,7 +1321,7 @@ uint32_t amfd_switch_qsd_actv (AVD_CL_CB > if (NCSCC_RC_SUCCESS != avd_rde_set_role(SA_AMF_HA_ACTIVE)) { > LOG_ER("rde role change failed from qsd -> actv"); > } > - return amfd_switch_stdby_actv(cb); > + return amfd_switch_stdby_actv(cb, false); > } > > > diff --git a/src/amf/amfd/role.h b/src/amf/amfd/role.h > --- a/src/amf/amfd/role.h > +++ b/src/amf/amfd/role.h > @@ -31,7 +31,7 @@ extern uint32_t avd_d2d_chg_role_rsp(AVD > extern uint32_t avd_d2d_chg_role_req(AVD_CL_CB *cb, > AVD_ROLE_CHG_CAUSE_T cause, SaAmfHAStateT role); > > extern uint32_t amfd_switch_qsd_stdby(AVD_CL_CB *cb); > -extern uint32_t amfd_switch_stdby_actv(AVD_CL_CB *cb); > +extern uint32_t amfd_switch_stdby_actv(AVD_CL_CB *cb, bool); > extern uint32_t amfd_switch_qsd_actv(AVD_CL_CB *cb); > extern uint32_t amfd_switch_actv_qsd(AVD_CL_CB *cb); > extern uint32_t initialize_for_assignment(cl_cb_tag* cb, > > > ------------------------------------------------------------------------------ Announcing the Oxford Dictionaries API! The API offers world-renowned dictionary content that is easy and intuitive to access. Sign up for an account today to start using our lexical data to power your apps and projects. Get started today and enter our developer competition. http://sdm.link/oxford _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
