osaf/services/saf/immsv/immnd/ImmModel.cc | 15 ++++++++++-----
osaf/services/saf/immsv/immnd/immnd_evt.c | 8 +++++++-
2 files changed, 17 insertions(+), 6 deletions(-)
Symptoms are during upgrade to OpenSAF 4.5:
May 16 12:01:03 SC-2 local0.err osafimmnd[427]: ER Can not sync Ccb that is
active
The cause of the problem (expected actually) was that upgrade support had not
yet
been added to default (4.5). Addition of the mechanism for supporting upgrade of
immsv to OpensAF 4.5 is tracked by ticket #842.
Solution is first to get the implementation of [#842] pushed, then to get this
changeset pushed. This changeset uses the mechanism provided in [#842] to (a)
onlu allow saImmOmCcbValidate if protocol45 is allowed: and (b) revert to the
pre 4.5 protocol for syncing ccb-states if protocol45 is not allowed.
Note that saImmOmCcbAbort is not a problem because it does not depend on any
new message types.
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
@@ -10153,7 +10153,7 @@ SaAisErrorT ImmModel::adminOperationInvo
goto fake_obj;
}
LOG_NO("ERR_NOT_EXIST: Admin-op on OI rejected. Implementer
'%s' != adminowner '%s'",
- objectName.c_str(),
adminOwner->mAdminOwnerName.c_str());
+ objectName.c_str(), adminOwner->mAdminOwnerName.c_str());
}
TRACE_7("ERR_NOT_EXIST: object '%s' does not exist",
objectName.c_str());
@@ -15391,7 +15391,8 @@ ImmModel::finalizeSync(ImmsvOmFinalizeSy
TRACE_ENTER();
SaAisErrorT err=SA_AIS_OK;
osafassert(!(isCoord && isSyncClient));
-
+ bool prt45allowed = this->protocol45Allowed();
+
switch(sImmNodeState){
case IMM_NODE_W_AVAILABLE:
osafassert(isSyncClient);
@@ -15599,7 +15600,11 @@ ImmModel::finalizeSync(ImmsvOmFinalizeSy
ImmsvCcbOutcomeList* ol = (ImmsvCcbOutcomeList *)
calloc(1, sizeof(ImmsvCcbOutcomeList));
ol->ccbId = (*ccbItr)->mId;
- ol->ccbState = (*ccbItr)->mState;
+ /* OpenSAF 4.5 adds two new ccb states before IMM_CCB_PREPARE.
Only terminated
+ Ccbs can currently be synced (COMMITTED or ABORTED). These two
states are
+ shifted up by 2 in OpenSAF 4.5
+ */
+ ol->ccbState = prt45allowed ? (*ccbItr)->mState :
((*ccbItr)->mState - 2);
ol->next = req->ccbResults;
req->ccbResults = ol;
}
@@ -15872,7 +15877,7 @@ ImmModel::finalizeSync(ImmsvOmFinalizeSy
newCcb->mOriginatingNode = 0;
newCcb->mOriginatingConn = 0;
newCcb->mVeto = SA_AIS_OK;
- newCcb->mState = (ImmCcbState) ol->ccbState;
+ newCcb->mState = (ImmCcbState) (prt45allowed ? ol->ccbState :
(ol->ccbState + 2));
newCcb->mWaitStartTime = time(NULL);
if(newCcb->mWaitStartTime <= ((time_t) 0)) {
LOG_ER("newCcb->mWaitStartTime <= 0");
@@ -16165,7 +16170,7 @@ ImmModel::finalizeSync(ImmsvOmFinalizeSy
++gone;
} else {
CcbInfo* ccb = *i1;
- if(ccb->mState != (ImmCcbState) ol->ccbState) {
+ if(ccb->mState != (ImmCcbState) (prt45allowed ?
ol->ccbState : (ol->ccbState + 2))) {
LOG_ER("ccb->mState:%u != ol->ccbState:%u for
CCB:%u",
ccb->mState, ol->ccbState, ccb->mId);
osafassert(ccb->mState == (ImmCcbState) ol->ccbState);
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
@@ -3051,8 +3051,14 @@ static SaAisErrorT immnd_fevs_local_chec
}
break;
+ case IMMND_EVT_A2ND_CCB_VALIDATE:
+ if(!immModel_protocol45Allowed(cb)) {
+ LOG_NO("saImmOmCcbValidate rejected during upgrade to
4.5 (OPENSAF_IMM_FLAG_PRT45_ALLOW is false)");
+ error = SA_AIS_ERR_NO_RESOURCES;
+ break;
+ }
+ /* intentional fallthrough. */
case IMMND_EVT_A2ND_CCB_APPLY:
- case IMMND_EVT_A2ND_CCB_VALIDATE:
if(immModel_pbeNotWritable(cb)) {
/* NO_RESOURCES is here imm internal proxy for
TRY_AGAIN.
The library code for saImmOmCcbApply will translate
NO_RESOURCES
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel