Hi Vijay

It seems as this is getting a bit messy. These loops are added all over the 
place and (at least) in one case one of the loops did not work since it 
included a function that does more than one thing and at least one thing the 
function does did not fail the first time and can because of that not be done 
again even if some other part failed etc.
It seem as it is mostly IMM handling that is simplified so that possibilities 
of recovery is not used.
I think that if we continue to fix things like this we will soon lose control. 
I suggest that we do the following instead:
We need to handle recovery and “real” fails:

1. Creating CCBs:
Doing this is rather complicated if all rules shall be followed and all 
recovery possibilities shall be used.
In SMF this is done in many places and in most cases only TRY_AGAIN is handled 
(there is also a lot of redundant code), everything else is considered a Fail 
(will fail the campaign).
I am currently working on a “generic” solution  that can be used in all places 
where the IMM model shall be modified using a CCB. I think this is the most 
complicated part.

2. Admin operations:
This is also done in a simplified way in many places and in different ways with 
redundant code. If we fix CCB handling to be able to recover from e.g. 
BAD_HANDLE we will still fail here so also Admin operations should be handled 
in a “generic” way. I think this is simpler to do than CCB handling.

3. There are probably other OM operations as well that needs to be fixed

What is your opinion about this? After CCB handling, what do you think is most 
important?

Regards
Lennart

From: Vijay Roy [mailto:vijay....@oracle.com]
Sent: den 17 november 2017 07:13
To: Rafael Odzakow <rafael.odza...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Lennart Lund 
<lennart.l...@ericsson.com>
Subject: RE: [PATCH 1/1] smf: SMF created a CCB to create smfRollbackElement 
object, but CCB was aborted due to IMM [#2676]


Hi Rafael,



We need the while loop in “SmfCampaignWrapup::executeCampComplete()” as we 
encountered the issue at Wrapup too while testing.



Thanks

Vijay





-----Original Message-----
From: Rafael Odzakow [mailto:rafael.odza...@ericsson.com]
Sent: Thursday, November 16, 2017 8:54 PM
To: Vijay Roy <vijay....@oracle.com<mailto:vijay....@oracle.com>>
Cc: 
opensaf-devel@lists.sourceforge.net<mailto:opensaf-devel@lists.sourceforge.net>;
 Lennart Lund <lennart.l...@ericsson.com<mailto:lennart.l...@ericsson.com>>
Subject: Re: [PATCH 1/1] smf: SMF created a CCB to create smfRollbackElement 
object, but CCB was aborted due to IMM [#2676]



What about the added while loops in

SmfCampaignWrapup::executeCampComplete() should they be removed now with this 
addition?





On 11/16/2017 10:44 AM, Vijay Roy wrote:

> Handling ERROR_EXIST in smfRollbackElement creation and handling

> TRY_AGAIN in immCCBOperations.

> ---

>   src/smf/smfd/SmfUpgradeAction.cc | 26 +++++++++++++++++++-------

>   1 file changed, 19 insertions(+), 7 deletions(-)

>

> diff --git a/src/smf/smfd/SmfUpgradeAction.cc

> b/src/smf/smfd/SmfUpgradeAction.cc

> index 94c3dfd..af75cd7 100644

> --- a/src/smf/smfd/SmfUpgradeAction.cc

> +++ b/src/smf/smfd/SmfUpgradeAction.cc

> @@ -28,6 +28,7 @@

>   #include "smf/smfd/SmfUtils.h"

>   #include "smfd.h"

>   #include "smf/smfd/SmfTargetTemplate.h"

> +#include "base/time.h"

>

>   /* ========================================================================

>    *   DEFINITIONS

> @@ -460,6 +461,7 @@ SaAisErrorT SmfImmCcbAction::execute(SaImmOiHandleT 
> i_oiHandle,

>                                        const std::string* i_rollbackDn) {

>     SaAisErrorT result = SA_AIS_OK;

>     SmfRollbackCcb* rollbackCcb = NULL;

> +  base::Timer doImmOpTimer(60000);

>

>     TRACE_ENTER();

>

> @@ -473,8 +475,8 @@ SaAisErrorT SmfImmCcbAction::execute(SaImmOiHandleT 
> i_oiHandle,

>       immRollbackCcbDn += ",";

>       immRollbackCcbDn += *i_rollbackDn;

>

> -    if ((result = smfCreateRollbackElement(immRollbackCcbDn, i_oiHandle)) !=

> -        SA_AIS_OK) {

> +    result = smfCreateRollbackElement(immRollbackCcbDn, i_oiHandle);

> +    if ((result != SA_AIS_OK) && (result != SA_AIS_ERR_EXIST)) {

>         LOG_ER(

>             "SmfImmCcbAction::execute failed to create rollback element %s, 
> rc=%s",

>             immRollbackCcbDn.c_str(), saf_error(result)); @@ -490,11

> +492,21 @@ SaAisErrorT SmfImmCcbAction::execute(SaImmOiHandleT i_oiHandle,

>     }

>

>     if (m_operations.size() > 0) {

> -    SmfImmUtils immUtil;

> -    if ((result = immUtil.doImmOperations(m_operations, rollbackCcb)) !=

> -        SA_AIS_OK) {

> -      delete rollbackCcb;

> -      rollbackCcb = NULL;

> +

> +    doImmOpTimer.set_timeout_time(60000);

> +    while (doImmOpTimer.is_timeout() == false) {

> +      SmfImmUtils immUtil;

> +      result = immUtil.doImmOperations(m_operations, rollbackCcb);

> +      if (result == SA_AIS_ERR_TRY_AGAIN) {

> +         base::Sleep(base::kFiveHundredMilliseconds);

> +         continue;

> +      } else if (result != SA_AIS_OK) {

> +         LOG_WA("%s: SmfImmCcbAction:execute Fail '%s'",

> +                 __FUNCTION__, saf_error(result));

> +         delete rollbackCcb;

> +         rollbackCcb = NULL;

> +      }

> +      break;

>       }

>     }

>




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to