Hi Minh, Ack, Reviewed & Tested.
Regards, Ravi -----Original Message----- From: Minh Chau [mailto:[email protected]] Sent: Monday, November 06, 2017 8:15 AM To: [email protected]; [email protected]; [email protected] Cc: [email protected]; Minh Chau <[email protected]> Subject: [PATCH 1/1] amfnd: Return TRY_AGAIN for pg track start/stop during headless sync [#2660] The problem with pg track start/stop is similar to data_update msg that caused msg id out of order in ticket #2601. Amfnd can buffer the pg track/stop messages in the same way as data_update, instead amfnd can also return TRY_AGAIN while the headless sync is still going on. That avoids buffering messages and re-attaching msg_id and resend the pg track messages after headless sync. The retry mechanism is done at application's side, who should already being handle TRY_AGAIN return code. --- src/amf/amfd/pg.cc | 2 +- src/amf/amfnd/pg.cc | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/amf/amfd/pg.cc b/src/amf/amfd/pg.cc index c087d021..4d1a292 100644 --- a/src/amf/amfd/pg.cc +++ b/src/amf/amfd/pg.cc @@ -74,7 +74,7 @@ void avd_pg_trk_act_evh(AVD_CL_CB *cb, AVD_EVT *evt) { goto done; /* Update the receive id for the node */ - m_AVD_SET_AVND_RCV_ID(cb, node, (n2d_msg->msg_info.n2d_reg_su.msg_id)); + m_AVD_SET_AVND_RCV_ID(cb, node, + (n2d_msg->msg_info.n2d_pg_trk_act.msg_id)); if ((node->node_state == AVD_AVND_STATE_ABSENT) || (node->node_state == AVD_AVND_STATE_GO_DOWN)) { diff --git a/src/amf/amfnd/pg.cc b/src/amf/amfnd/pg.cc index 441ddb2..2f4dbad 100644 --- a/src/amf/amfnd/pg.cc +++ b/src/amf/amfnd/pg.cc @@ -149,8 +149,9 @@ uint32_t avnd_evt_ava_pg_start_evh(AVND_CB *cb, AVND_EVT *evt) { TRACE_ENTER(); // if headless, return TRY_AGAIN to application - if (cb->is_avd_down == true) { - LOG_NO("Director is down. Return try again for PG start."); + if (cb->is_avd_down == true || cb->amfd_sync_required == true) { + LOG_NO("Director is down(%d), or sync is required(%d). Return try again" + "for PG start.", cb->is_avd_down, cb->amfd_sync_required); rc = avnd_amf_resp_send(cb, AVSV_AMF_PG_START, SA_AIS_ERR_TRY_AGAIN, 0, &api_info->dest, &evt->mds_ctxt, nullptr, false); TRACE_LEAVE(); @@ -242,8 +243,9 @@ uint32_t avnd_evt_ava_pg_stop_evh(AVND_CB *cb, AVND_EVT *evt) { TRACE_ENTER(); // if headless, return TRY_AGAIN to application - if (cb->is_avd_down == true) { - LOG_NO("Director is down. Return try again for PG stop."); + if (cb->is_avd_down == true || cb->amfd_sync_required == true) { + LOG_NO("Director is down(%d), or sync is required(%d). Return try again" + "for PG stop.", cb->is_avd_down, cb->amfd_sync_required); rc = avnd_amf_resp_send(cb, AVSV_AMF_PG_STOP, SA_AIS_ERR_TRY_AGAIN, 0, &api_info->dest, &evt->mds_ctxt, nullptr, false); TRACE_LEAVE(); -- 2.7.4 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
