Hi Ravi I’ve started looking at this. My initial thought is that perhaps we need to queue up all messages when is_avd_down == false && amfd_sync_required == true (ie. AMFD has come up but haven’t accepted node_up). What do you think?
Will get back to you. /Gary -----Original Message----- From: ravi-sekhar <ravisekhar.ko...@oracle.com> Date: Tuesday, 17 October 2017 at 10:39 pm To: <hans.nordeb...@ericsson.com> Cc: <opensaf-devel@lists.sourceforge.net> Subject: [devel] [PATCH 1/1] amf: Buffer and resend data req messages in Headless state [#2601] --- src/amf/amfnd/di.cc | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/src/amf/amfnd/di.cc b/src/amf/amfnd/di.cc index 2dc023c..1e0d682 100644 --- a/src/amf/amfnd/di.cc +++ b/src/amf/amfnd/di.cc @@ -998,21 +998,30 @@ uint32_t avnd_di_object_upd_send(AVND_CB *cb, AVSV_PARAM_INFO *param) { uint32_t rc = NCSCC_RC_SUCCESS; TRACE_ENTER2("Comp '%s'", osaf_extended_name_borrow(¶m->name)); - if (cb->is_avd_down == true) { - TRACE_LEAVE2("AVD is down. %u", rc); - return rc; - } - - memset(&msg, 0, sizeof(AVND_MSG)); - /* populate the msg */ + memset(&msg, 0, sizeof(AVND_MSG)); msg.info.avd = static_cast<AVSV_DND_MSG *>(calloc(1, sizeof(AVSV_DND_MSG))); msg.type = AVND_MSG_AVD; msg.info.avd->msg_type = AVSV_N2D_DATA_REQUEST_MSG; - msg.info.avd->msg_info.n2d_data_req.msg_id = ++(cb->snd_msg_id); msg.info.avd->msg_info.n2d_data_req.node_id = cb->node_info.nodeId; msg.info.avd->msg_info.n2d_data_req.param_info = *param; + if ((cb->is_avd_down == true) || (cb->amfd_sync_required == true)) { + msg.info.avd->msg_info.n2d_data_req.msg_id = 0; + if (avnd_diq_rec_add(cb, &msg) == nullptr) { + rc = NCSCC_RC_FAILURE; + } + LOG_NO( + "avnd_di_object_upd_send() deferred as AMF director is offline(%d)," + " or sync is required(%d)", + cb->is_avd_down, cb->amfd_sync_required); + + TRACE_LEAVE2("AVD is down. %u", rc); + return rc; + } else { + msg.info.avd->msg_info.n2d_data_req.msg_id = ++(cb->snd_msg_id); + } + /* send the msg to AvD */ rc = avnd_di_msg_send(cb, &msg); if (NCSCC_RC_SUCCESS == rc) msg.info.avd = 0; @@ -1515,9 +1524,20 @@ void avnd_diq_rec_send_buffered_msg(AVND_CB *cb) { pending_rec->msg.info.avd->msg_info.n2d_opr_state.rec_rcvr .raw); ++iter; - } else { - ++iter; - } + } else if (pending_rec->msg.info.avd->msg_type == AVSV_N2D_DATA_REQUEST_MSG && + pending_rec->msg.info.avd->msg_info.n2d_data_req.msg_id == 0) { + pending_rec->msg.info.avd->msg_info.n2d_data_req.msg_id = + ++(cb->snd_msg_id); + + LOG_NO( + "Found and resend buffered Data Req msg for SU:'%s', msg_id:'%u'", + osaf_extended_name_borrow(&pending_rec->msg.info.avd->msg_info + .n2d_data_req.param_info.name), + pending_rec->msg.info.avd->msg_info.n2d_data_req.msg_id); + ++iter; + } else { + ++iter; + } } TRACE("retransmit message to amfd"); -- 1.9.1 ------------------------------------------------------------------------------ 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 Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel ------------------------------------------------------------------------------ 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 Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel