Re: [devel] [PATCH 1 of 1] IMM: Correction to support for admin-op for aborting non critical ccbs [#1107]

2015-05-21 Thread Zoran Milinkovic
Ack from me.
Reviewed, but not tested.

Best regards,
Zoran

-Original Message-
From: Anders Björnerstedt 
Sent: Wednesday, May 20, 2015 11:57 PM
To: reddy.neelaka...@oracle.com; Zoran Milinkovic
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] IMM: Correction to support for admin-op for aborting 
non critical ccbs [#1107]

 osaf/services/saf/immsv/immnd/ImmModel.cc |  34 --
 1 files changed, 23 insertions(+), 11 deletions(-)


The original fix only worked for aborting CCBs where there was an OI
actively involved in processing a ccb callback at the time of the admin-op.
It did  not work for the case where the CCB was currently idle, i.e. waiting
for the next operation from the om-client and OIs waiting for the next
callback corrsponding to the next om-request.

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
@@ -351,7 +351,7 @@ struct CcbInfo
 SaAisErrorT   mVeto;  //SA_AIS_OK as long as no participan voted 
error.
 time_tmWaitStartTime;
 SaUint32T mOpCount;
-SaUint32T mPbeRestartId;
+SaUint32T mPbeRestartId; /* ImplId for new PBE to resolve CCBs in 
critical */
 ImplementerSetmLocalAppliers;
 ImmsvAttrNameList* mErrorStrings;/*Error strings generated by current op */
 AugCcbParent* mAugCcbParent;
@@ -5634,7 +5634,19 @@ ImmModel::ccbAbort(SaUint32T ccbId, Conn
 *client = ccb-mOriginatingConn;
 
 ccb-mState = IMM_CCB_ABORTED;
-ccb-mVeto = SA_AIS_ERR_FAILED_OPERATION;
+if(ccb-mVeto == SA_AIS_OK) {
+/* An abort of a CCB currently not vetoed is most likely due to
+   either OI-timeout, or explicit abort by the om-client, or
+   abort by special admin-operation. All such cases must be 
+   regarded as a resource error rather than a validation error.
+   Only an explicit reject of a ccb from an OI can be defined as
+   a validation error. Explicit abort by om-client or admin-op is
+   not really any error at all, but mVeto should not be SA_AIS_OK.
+*/
+ccb-mVeto = SA_AIS_ERR_NO_RESOURCES;
+setCcbErrorString(ccb, Resource Error: CCB abort due to either 
+OI timeout or explicit abort request.);
+}
 
 ccb-mWaitStartTime = 0;
 
@@ -12504,10 +12516,12 @@ ImmModel::cleanTheBasement(InvocVector 
 }
 
 uint32_t oi_timeout = ((*i3)-mState == IMM_CCB_CRITICAL) ? 
DEFAULT_TIMEOUT_SEC : max_oi_timeout;
-if(((*i3)-mWaitStartTime 
-(now - (*i3)-mWaitStartTime = (int)oi_timeout)) ||
-((*i3)-mPbeRestartId)) {
-if((*i3)-mPbeRestartId) {
+if(((*i3)-mWaitStartTime  (now - (*i3)-mWaitStartTime = 
(int)oi_timeout)) || /* normal timeout */
+   ((*i3)-mPbeRestartId) ||  /* CCB was critical when PBE 
restarted = Must ask new PBE for outcome */
+   sAbortNonCriticalCcbs)  /* Request to abort ALL non critical 
CCBs */
+{
+if((*i3)-mPbeRestartId)
+{
 oi_timeout = 0;
 TRACE_5(PBE restarted id:%u with ccb:%u in critical,
 (*i3)-mPbeRestartId, (*i3)-mId);
@@ -12515,15 +12529,11 @@ ImmModel::cleanTheBasement(InvocVector 
 oi_timeout = 0;
 TRACE_5(CCB %u timeout while waiting on implementer 
reply,
 (*i3)-mId);
-setCcbErrorString(*i3, Resource Error: CCB timeout while 
- waiting on implementer reply);
 } 
 
 if(sAbortNonCriticalCcbs) {
 LOG_NO(CCB %u aborted by: immadm -o %u 
safRdn=immManagement,safApp=safImmService,
 (*i3)-mId, SA_IMM_ADMIN_ABORT_CCBS);
-setCcbErrorString(*i3, Resource Error: CCB aborted by 
admin-operation
- '%u' on safRdn=immManagement,safApp=safImmService, 
SA_IMM_ADMIN_ABORT_CCBS);
 }
 
 if((*i3)-mState == IMM_CCB_CRITICAL) {
@@ -12543,7 +12553,9 @@ ImmModel::cleanTheBasement(InvocVector 
 ccbsStuck=1;
 }
 } else if(!oi_timeout) {
-// oi_timeout set to 0 means that the ccb should be added 
to the vector
+/* oi_timeout set to 0 means that the ccb should be added 
to the vector.
+   CCB will be aborted only after the global abort 
generated here by the coord
+   arrives back over fevs.*/
 ccbs.push_back((*i3)-mId); /*Non critical ccb to abort.*/
 }
 }

--
One dashboard for servers and 

[devel] [PATCH 1 of 1] IMM: Correction to support for admin-op for aborting non critical ccbs [#1107]

2015-05-20 Thread Anders Bjornerstedt
 osaf/services/saf/immsv/immnd/ImmModel.cc |  34 --
 1 files changed, 23 insertions(+), 11 deletions(-)


The original fix only worked for aborting CCBs where there was an OI
actively involved in processing a ccb callback at the time of the admin-op.
It did  not work for the case where the CCB was currently idle, i.e. waiting
for the next operation from the om-client and OIs waiting for the next
callback corrsponding to the next om-request.

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
@@ -351,7 +351,7 @@ struct CcbInfo
 SaAisErrorT   mVeto;  //SA_AIS_OK as long as no participan voted 
error.
 time_tmWaitStartTime;
 SaUint32T mOpCount;
-SaUint32T mPbeRestartId;
+SaUint32T mPbeRestartId; /* ImplId for new PBE to resolve CCBs in 
critical */
 ImplementerSetmLocalAppliers;
 ImmsvAttrNameList* mErrorStrings;/*Error strings generated by current op */
 AugCcbParent* mAugCcbParent;
@@ -5634,7 +5634,19 @@ ImmModel::ccbAbort(SaUint32T ccbId, Conn
 *client = ccb-mOriginatingConn;
 
 ccb-mState = IMM_CCB_ABORTED;
-ccb-mVeto = SA_AIS_ERR_FAILED_OPERATION;
+if(ccb-mVeto == SA_AIS_OK) {
+/* An abort of a CCB currently not vetoed is most likely due to
+   either OI-timeout, or explicit abort by the om-client, or
+   abort by special admin-operation. All such cases must be 
+   regarded as a resource error rather than a validation error.
+   Only an explicit reject of a ccb from an OI can be defined as
+   a validation error. Explicit abort by om-client or admin-op is
+   not really any error at all, but mVeto should not be SA_AIS_OK.
+*/
+ccb-mVeto = SA_AIS_ERR_NO_RESOURCES;
+setCcbErrorString(ccb, Resource Error: CCB abort due to either 
+OI timeout or explicit abort request.);
+}
 
 ccb-mWaitStartTime = 0;
 
@@ -12504,10 +12516,12 @@ ImmModel::cleanTheBasement(InvocVector 
 }
 
 uint32_t oi_timeout = ((*i3)-mState == IMM_CCB_CRITICAL) ? 
DEFAULT_TIMEOUT_SEC : max_oi_timeout;
-if(((*i3)-mWaitStartTime 
-(now - (*i3)-mWaitStartTime = (int)oi_timeout)) ||
-((*i3)-mPbeRestartId)) {
-if((*i3)-mPbeRestartId) {
+if(((*i3)-mWaitStartTime  (now - (*i3)-mWaitStartTime = 
(int)oi_timeout)) || /* normal timeout */
+   ((*i3)-mPbeRestartId) ||  /* CCB was critical when PBE 
restarted = Must ask new PBE for outcome */
+   sAbortNonCriticalCcbs)  /* Request to abort ALL non critical 
CCBs */
+{
+if((*i3)-mPbeRestartId)
+{
 oi_timeout = 0;
 TRACE_5(PBE restarted id:%u with ccb:%u in critical,
 (*i3)-mPbeRestartId, (*i3)-mId);
@@ -12515,15 +12529,11 @@ ImmModel::cleanTheBasement(InvocVector 
 oi_timeout = 0;
 TRACE_5(CCB %u timeout while waiting on implementer 
reply,
 (*i3)-mId);
-setCcbErrorString(*i3, Resource Error: CCB timeout while 
- waiting on implementer reply);
 } 
 
 if(sAbortNonCriticalCcbs) {
 LOG_NO(CCB %u aborted by: immadm -o %u 
safRdn=immManagement,safApp=safImmService,
 (*i3)-mId, SA_IMM_ADMIN_ABORT_CCBS);
-setCcbErrorString(*i3, Resource Error: CCB aborted by 
admin-operation
- '%u' on safRdn=immManagement,safApp=safImmService, 
SA_IMM_ADMIN_ABORT_CCBS);
 }
 
 if((*i3)-mState == IMM_CCB_CRITICAL) {
@@ -12543,7 +12553,9 @@ ImmModel::cleanTheBasement(InvocVector 
 ccbsStuck=1;
 }
 } else if(!oi_timeout) {
-// oi_timeout set to 0 means that the ccb should be added 
to the vector
+/* oi_timeout set to 0 means that the ccb should be added 
to the vector.
+   CCB will be aborted only after the global abort 
generated here by the coord
+   arrives back over fevs.*/
 ccbs.push_back((*i3)-mId); /*Non critical ccb to abort.*/
 }
 }

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___