Hi Zoran,

The patch is not backward compatible.
The following changes are required :

1. create  immModel_protocol50Allowed
2. For each check in class/object set/release check the protcol50 flag
3. In the case of upgrade, when the protocal50 is enabled, then clear 
all class/object applier
information which is not originated from that node.

/Neel.

On Wednesday 04 November 2015 06:56 PM, Zoran Milinkovic wrote:
>   osaf/services/saf/immsv/immnd/ImmModel.cc  |  11 +++++++-
>   osaf/services/saf/immsv/immnd/immnd_evt.c  |  40 
> ++++++++++++++++++++++++++++++
>   osaf/services/saf/immsv/immnd/immnd_init.h |   2 +
>   3 files changed, 52 insertions(+), 1 deletions(-)
>
>
> When saImmOiObjectImplementerSet, saImmOiClassImplementerSet, 
> saImmOiObjectImplementerRelease and saImmOiClassImplementerRelease are 
> invoked for appliers, the calls will be only local and will not use fevs.
> Object and class applier set info will be stored only on the local node.
>
> 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
> @@ -717,6 +717,15 @@ immModel_genSpecialModify(IMMND_CB *cb,
>           genSpecialModify(req);
>   }
>   
> +SaBoolT
> +immModel_isApplier(IMMND_CB *cb, SaUint32T implId) {
> +    ImplementerInfo *info = 
> ImmModel::instance(&cb->immModel)->findImplementer(implId);
> +    if(!info) {
> +        return SA_FALSE;
> +    }
> +
> +    return (info->mApplier) ? SA_TRUE : SA_FALSE;
> +}
>   
>   SaUint32T
>   immModel_getLocalAppliersForObj(IMMND_CB *cb,
> @@ -13104,7 +13113,7 @@ ImmModel::implementerSet(const IMMSV_OCT
>                           goto done;
>                       }
>   
> -                    if(isApplier) {
> +                    if(isApplier && conn) {
>                           if( ! obj->mClassInfo->mAppliers.empty()) {
>                               ImplementerSet::iterator ii = 
> obj->mClassInfo->mAppliers.begin();
>                               for(; ii != obj->mClassInfo->mAppliers.end(); 
> ++ii) {
> 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
> @@ -2894,6 +2894,12 @@ static uint32_t immnd_evt_proc_fevs_forw
>                                */
>                               osafassert(immModel_immNotWritable(cb));
>                               error = SA_AIS_OK;
> +                     } else if(error == SA_AIS_ERR_NO_OP) {
> +                             /* Internal error code which means that
> +                              * the message will not be sent over fevs.
> +                              * Message is processed only locally.
> +                              */
> +                             error = SA_AIS_OK;
>                       }
>   
>                       if(asyncReq) {
> @@ -3349,6 +3355,15 @@ static SaAisErrorT immnd_fevs_local_chec
>               } else if(cb->mSyncFinalizing) {
>                       //Writable, but sync is finalizing at coord.
>                       error = SA_AIS_ERR_TRY_AGAIN;
> +             } else if(immModel_isApplier(cb, 
> frwrd_evt.info.immnd.info.implSet.impl_id)) {
> +                     SaUint32T ccbId=0;
> +                     error = immModel_classImplementerSet(cb, 
> &(frwrd_evt.info.immnd.info.implSet), conn,
> +                             nodeId, &ccbId);
> +
> +                     /* Returning SA_AIS_ERR_NO_OP means that the message 
> will not be sent over fevs */
> +                     if(error == SA_AIS_OK || error == 
> SA_AIS_ERR_NO_BINDINGS) {
> +                             error = SA_AIS_ERR_NO_OP;
> +                     }
>               }
>               /* Else when imm is writable, idempotency can not be trusted 
> locally.
>                  OK will be returned, which will trigger forwarding over 
> fevs. */
> @@ -3381,6 +3396,15 @@ static SaAisErrorT immnd_fevs_local_chec
>               } else if(cb->mSyncFinalizing) {
>                       //Writable, but sync is finalizing at coord.
>                       error = SA_AIS_ERR_TRY_AGAIN;
> +             } else if(immModel_isApplier(cb, 
> frwrd_evt.info.immnd.info.implSet.impl_id)) {
> +                     SaUint32T ccbId=0;
> +                     error = immModel_objectImplementerSet(cb, 
> &(frwrd_evt.info.immnd.info.implSet), conn,
> +                             nodeId, &ccbId);
> +
> +                     /* Returning SA_AIS_ERR_NO_OP means that the message 
> will not be sent over fevs */
> +                     if(error == SA_AIS_OK || error == 
> SA_AIS_ERR_NO_BINDINGS) {
> +                             error = SA_AIS_ERR_NO_OP;
> +                     }
>               }
>               /* Else when imm is writable, idempotency can not be trusted 
> locally.
>                  OK will be returned, which will trigger forwarding over 
> fevs. */
> @@ -3398,6 +3422,14 @@ static SaAisErrorT immnd_fevs_local_chec
>               if(fevsReq->sender_count != 0x1) {
>                       LOG_WA("ERR_LIBRARY: IMMND_EVT_A2ND_OI_CL_IMPL_REL 
> fevsReq->sender_count != 0x1");
>                       error = SA_AIS_ERR_LIBRARY;
> +             } else if(immModel_isApplier(cb, 
> frwrd_evt.info.immnd.info.implSet.impl_id)) {
> +                     error = immModel_classImplementerRelease(cb, 
> &(frwrd_evt.info.immnd.info.implSet),
> +                                     conn, nodeId);
> +
> +                     /* Returning SA_AIS_ERR_NO_OP means that the message 
> will not be sent over fevs */
> +                     if(error == SA_AIS_OK || error == 
> SA_AIS_ERR_NO_BINDINGS) {
> +                             error = SA_AIS_ERR_NO_OP;
> +                     }
>               }
>               break;
>   
> @@ -3405,6 +3437,14 @@ static SaAisErrorT immnd_fevs_local_chec
>               if(fevsReq->sender_count != 0x1) {
>                       LOG_WA("ERR_LIBRARY: IMMND_EVT_A2ND_OI_OBJ_IMPL_REL 
> fevsReq->sender_count != 0x1");
>                       error = SA_AIS_ERR_LIBRARY;
> +             } else if(immModel_isApplier(cb, 
> frwrd_evt.info.immnd.info.implSet.impl_id)) {
> +                     error = immModel_objectImplementerRelease(cb, 
> &(frwrd_evt.info.immnd.info.implSet),
> +                                     conn, nodeId);
> +
> +                     /* Returning SA_AIS_ERR_NO_OP means that the message 
> will not be sent over fevs */
> +                     if(error == SA_AIS_OK || error == 
> SA_AIS_ERR_NO_BINDINGS) {
> +                             error = SA_AIS_ERR_NO_OP;
> +                     }
>               }
>               break;
>   
> 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
> @@ -166,6 +166,8 @@ extern "C" {
>                   SaUint32T *continuationId, SaUint32T *pbeConn, SaClmNodeIdT 
> *pbeNodeId,
>                   SaNameT* objName, bool* dnOrRdnIsLong, bool isObjectDnUsed);
>   
> +     SaBoolT immModel_isApplier(IMMND_CB *cb, SaUint32T implId);
> +
>       SaUint32T immModel_getLocalAppliersForObj(IMMND_CB *cb, const SaNameT* 
> objName, SaUint32T ccbId,
>                   SaUint32T **aplConnArr, SaBoolT externalRep);
>       SaUint32T immModel_getLocalAppliersForCcb(IMMND_CB *cb, SaUint32T 
> ccbId, SaUint32T **aplConnArr,


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to