Hi Zoran, Reviewed and tested the patch. Ack from me.
Best Regards, Hung Nguyen - DEK Technologies -------------------------------------------------------------------------------- From: Zoran Milinkovic zoran.milinko...@ericsson.com Sent: Thursday, October 08, 2015 11:13AM To: Neelakanta Reddy reddy.neelaka...@oracle.com Cc: Opensaf-devel opensaf-devel@lists.sourceforge.net Subject: [devel] [PATCH 1 of 1] imm: synchronize applier set on all nodes [#1504] osaf/services/saf/immsv/immnd/ImmModel.cc | 12 +++++++++--- osaf/services/saf/immsv/immnd/ImmModel.hh | 3 ++- osaf/services/saf/immsv/immnd/immnd_evt.c | 15 ++++++++++----- osaf/services/saf/immsv/immnd/immnd_init.h | 2 +- 4 files changed, 22 insertions(+), 10 deletions(-) If applier fails on the local node, the global discard implementer message will be broadcasted to all nodes. diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc b/osaf/services/saf/immsv/immnd/ImmModel.cc --- a/osaf/services/saf/immsv/immnd/ImmModel.cc +++ b/osaf/services/saf/immsv/immnd/ImmModel.cc @@ -1589,7 +1589,7 @@ SaAisErrorT immModel_implementerSet(IMMND_CB *cb, const IMMSV_OCTET_STRING* implName, SaUint32T implConn, SaUint32T implNodeId, SaUint32T implId, MDS_DEST mds_dest, - SaUint32T implTimeout) + SaUint32T implTimeout, SaBoolT *discardImplementer) { return ImmModel::instance(&cb->immModel)->implementerSet(implName, @@ -1597,7 +1597,8 @@ immModel_implementerSet(IMMND_CB *cb, co implNodeId, implId, (SaUint64T) mds_dest, - implTimeout); + implTimeout, + discardImplementer); } SaAisErrorT @@ -13030,12 +13031,15 @@ ImmModel::implementerSet(const IMMSV_OCT SaUint32T nodeId, SaUint32T implementerId, SaUint64T mds_dest, - SaUint32T implTimeout) + SaUint32T implTimeout, + SaBoolT *discardImplementer) { SaAisErrorT err = SA_AIS_OK; CcbVector::iterator i; TRACE_ENTER(); + *discardImplementer = SA_FALSE; + if(immNotWritable() && !protocol43Allowed()) { TRACE_LEAVE(); return SA_AIS_ERR_TRY_AGAIN; @@ -13108,6 +13112,7 @@ ImmModel::implementerSet(const IMMSV_OCT TRACE("TRY_AGAIN: ccb %u is active on object '%s' " "bound to class applier '%s'. Can not re-attach applier", ccb->mId, omit->first.c_str(), implName.c_str()); + *discardImplementer = SA_TRUE; err = SA_AIS_ERR_TRY_AGAIN; goto done; } @@ -13121,6 +13126,7 @@ ImmModel::implementerSet(const IMMSV_OCT TRACE("TRY_AGAIN: ccb %u is active on object '%s' " "bound to object applier '%s'. Can not re-attach applier", ccb->mId, omit->first.c_str(), implName.c_str()); + *discardImplementer = SA_TRUE; err = SA_AIS_ERR_TRY_AGAIN; goto done; } diff --git a/osaf/services/saf/immsv/immnd/ImmModel.hh b/osaf/services/saf/immsv/immnd/ImmModel.hh --- a/osaf/services/saf/immsv/immnd/ImmModel.hh +++ b/osaf/services/saf/immsv/immnd/ImmModel.hh @@ -397,7 +397,8 @@ public: SaUint32T nodeId, SaUint32T ownerId, SaUint64T mds_dest, - SaUint32T implTimeout); + SaUint32T implTimeout, + SaBoolT *discardImplementer); SaAisErrorT classImplementerSet( const struct ImmsvOiImplSetReq* req, diff --git a/osaf/services/saf/immsv/immnd/immnd_evt.c b/osaf/services/saf/immsv/immnd/immnd_evt.c --- a/osaf/services/saf/immsv/immnd/immnd_evt.c +++ b/osaf/services/saf/immsv/immnd/immnd_evt.c @@ -9523,6 +9523,7 @@ static void immnd_evt_proc_impl_set_rsp( NCS_NODE_ID nodeId; SaUint32T conn; SaUint32T implId = 0; + SaBoolT discardImplementer = SA_FALSE; osafassert(evt); osafassert(!originatedAtThisNd || reply_dest == cb->immnd_mdest_id); @@ -9539,13 +9540,13 @@ static void immnd_evt_proc_impl_set_rsp( err = immModel_implementerSet(cb, &(evt->info.implSet.impl_name), (originatedAtThisNd) ? conn : 0, nodeId, implId, - reply_dest, evt->info.implSet.oi_timeout); + reply_dest, evt->info.implSet.oi_timeout, &discardImplementer); if (originatedAtThisNd) { /*Send reply to client from this ND. */ immnd_client_node_get(cb, clnt_hdl, &cl_node); - if (cl_node == NULL) { + if ((cl_node == NULL) || (discardImplementer == SA_TRUE)) { /* Client was down */ - TRACE_5("Failed to get client node, discarding implementer id:%u for connection: %u", implId, conn); + TRACE_5("Discarding implementer id:%u for connection: %u", implId, conn); memset(&send_evt, '\0', sizeof(IMMSV_EVT)); send_evt.type = IMMSV_EVT_TYPE_IMMD; send_evt.info.immd.type = IMMD_EVT_ND2D_DISCARD_IMPL; @@ -9556,8 +9557,12 @@ static void immnd_evt_proc_impl_set_rsp( /* Mark the implementer as dying to make sure no upcall is sent to the client. The implementer will be really discarded when global-discard message comes */ immModel_discardImplementer(cb, implId, SA_FALSE, NULL, NULL); - return; - } else if (cl_node->mIsStale) { + + if(cl_node == NULL) { + return; + } + } + if (cl_node->mIsStale) { LOG_WA("IMMND - Client went down so no response"); return; } diff --git a/osaf/services/saf/immsv/immnd/immnd_init.h b/osaf/services/saf/immsv/immnd/immnd_init.h --- a/osaf/services/saf/immsv/immnd/immnd_init.h +++ b/osaf/services/saf/immsv/immnd/immnd_init.h @@ -225,7 +225,7 @@ extern "C" { SaAisErrorT immModel_implementerSet(IMMND_CB *cb, const IMMSV_OCTET_STRING *implName, SaUint32T implConn, SaUint32T implNodeId, SaUint32T implId, - MDS_DEST mds_dest, SaUint32T implTimeout); + MDS_DEST mds_dest, SaUint32T implTimeout, SaBoolT *discardImplementer); SaAisErrorT immModel_implementerClear(IMMND_CB *cb, const struct ImmsvOiImplSetReq *req, ------------------------------------------------------------------------------ Full-scale, agent-less Infrastructure Monitoring from a single dashboard Integrate with 40+ ManageEngine ITSM Solutions for complete visibility Physical-Virtual-Cloud Infrastructure monitoring from one console Real user monitoring with APM Insights and performance trend reports Learn More http://pubads.g.doubleclick.net/gampad/clk?id=247754911&iu=/4140 _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel ------------------------------------------------------------------------------ _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel