Hi Hung,

First, I thought that it was safe to do object and class set during the rolling 
upgrade, but it might actually alter applier bindings on other nodes.
The whole purpose of this ticket is not to have this kind of changes with 
applier bindings on nodes.

I'll add this check in ImmModel::classImplementerXXXX and 
ImmModel::objectImplementerXXXX.

Thanks,
Zoran

-----Original Message-----
From: Hung Nguyen [mailto:[email protected]] 
Sent: Friday, November 06, 2015 12:30 PM
To: Zoran Milinkovic; [email protected]
Cc: [email protected]
Subject: Re: [devel] [PATCH 1 of 1] imm: skip fevs for object and class applier 
set/release call [#1535]

Hi Zoran,

Reviewed and tested the patch. Ack from me.

In case of cluster having nodes with different versions of OpenSAF (for 
example, rolling upgrade),
the 'old' nodes still send these messages (class/obj implementer set/release) 
over fevs,
and the 'new' nodes will still add the applier mapping.

Do you think we should consider adding some 'protection' to 
ImmModel::classImplementerSet (and 3 other similar functions)?
In those functions, if it's from remote nodes, we just return and do nothing.

BR,

Hung Nguyen - DEK Technologies


--------------------------------------------------------------------------------
From: Zoran Milinkovic [email protected]
Sent: Friday, November 06, 2015 6:09PM
To: Neelakanta Reddy
     [email protected]
Cc: Opensaf-devel
     [email protected]
Subject: [devel] [PATCH 1 of 1] imm: skip fevs for object and class applier 
set/release call [#1535]


  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,

------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel



------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to