Hi Lennart & Rafael,
Could you please check and provide ACK for this ticket[#2676] as spot fix. Since this is blocking our testing. Note: As discussed we can take up refactoring changes separately in ticket #1398. Thanks Vijay From: Lennart Lund [mailto:[email protected]] Sent: Tuesday, November 21, 2017 1:51 PM To: Vijay Roy <[email protected]>; Rafael Odzakow <[email protected]>; Syam Prasad Talluri <[email protected]> Cc: [email protected] Subject: RE: [PATCH 1/1] smf: SMF created a CCB to create smfRollbackElement object, but CCB was aborted due to IMM [#2676] Hi Vijay, I forgot to mention that this is ticket #1398 /Lennart From: Lennart Lund Sent: den 20 november 2017 13:33 To: Vijay Roy <HYPERLINK "mailto:[email protected]"[email protected]>; Rafael Odzakow <HYPERLINK "mailto:[email protected]"[email protected]>; HYPERLINK "mailto:[email protected]"[email protected] Cc: HYPERLINK "mailto:[email protected]"[email protected]; Lennart Lund <HYPERLINK "mailto:[email protected]"[email protected]> Subject: RE: [PATCH 1/1] smf: SMF created a CCB to create smfRollbackElement object, but CCB was aborted due to IMM [#2676] Hi Vijay, I have started to create a CCB handler handling all types of modifications of the IMM model where a CCB is involved (object create, modify and delete). It is created as a “separate module” that handles everything that has to do with IMM. This means, all steps involved in creating a CCB handling admin owner etc. It will do recovery when possible which includes everything from TRY_AGAIN to aborted CCB. It is handled using a well-defined and documented API. I will also include some shell commands that can be used as “demo” but also can be used for testing. These shell command will be built if –enable-tests is set when OpenSAF build is configured. The plan is to replace all “inline” IMM handling regarding CCBs. I have already implemented most of the code needed for a “create” and will soon start to test that part. When I have something that at least have some part working I will push for review and then push other parts for review in increments. In the mean time you can look at the API (as it looks so far). I have attached the .h file Thanks Lennart From: Vijay Roy [mailto:[email protected]] Sent: den 20 november 2017 09:57 To: Lennart Lund <HYPERLINK "mailto:[email protected]"[email protected]>; Rafael Odzakow <HYPERLINK "mailto:[email protected]"[email protected]>; HYPERLINK "mailto:[email protected]"[email protected] Cc: HYPERLINK "mailto:[email protected]"[email protected] Subject: RE: [PATCH 1/1] smf: SMF created a CCB to create smfRollbackElement object, but CCB was aborted due to IMM [#2676] Hi Lennart, In reality myself and Syam are also thinking on the same lines for refactoring CCB & Admin operations flows. In addition we need to have an eye on CLI & Customized Callback Actions. Better we discuss more in detail to baseline the solution. Please suggest. Regards Vijay From: Lennart Lund [mailto:[email protected]] Sent: Friday, November 17, 2017 9:47 PM To: Vijay Roy <HYPERLINK "mailto:[email protected]"[email protected]>; Rafael Odzakow <HYPERLINK "mailto:[email protected]"[email protected]>; Lennart Lund <HYPERLINK "mailto:[email protected]"[email protected]> Cc: HYPERLINK "mailto:[email protected]"[email protected] Subject: RE: [PATCH 1/1] smf: SMF created a CCB to create smfRollbackElement object, but CCB was aborted due to IMM [#2676] 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:[email protected]] Sent: den 17 november 2017 07:13 To: Rafael Odzakow <HYPERLINK "mailto:[email protected]"[email protected]> Cc: HYPERLINK "mailto:[email protected]"[email protected]; Lennart Lund <HYPERLINK "mailto:[email protected]"[email protected]> 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:[email protected]] Sent: Thursday, November 16, 2017 8:54 PM To: Vijay Roy <HYPERLINK "mailto:[email protected]"[email protected]> Cc: HYPERLINK "mailto:[email protected]"[email protected]; Lennart Lund <HYPERLINK "mailto:[email protected]"[email protected]> 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 [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
