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 Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel