ACK with comment. See [Lennart] inline

Thanks
Lennart

> -----Original Message-----
> From: Rafael Odzakow
> Sent: den 28 oktober 2016 12:45
> To: [email protected]; Lennart Lund
> <[email protected]>
> Cc: [email protected]
> Subject: [PATCH 1 of 1] smf: balanced upgrade, modifications missing after
> reboot [#2147]
> 
>  osaf/services/saf/smfsv/smfd/SmfUpgradeProcedure.cc |  23
> +++++++++++++-------
>  1 files changed, 15 insertions(+), 8 deletions(-)
> 
> 
> The issue happens duing balanced upgrade when doing an SI SWAP on the
> controllers just before starting the balanced procedures. In this case SMF
> normally would read the IMM data for any step modifications ticket [#906]
> changed that to not read any modifications when the procedures are in
> COMPLETE
> state. Solution is to keep the behaviour in a non balanced upgrade. When
> executing a balanced upgrade the modifications are read and a error check
> (forAddRemove and forModify) is skipped.
> 
> diff --git a/osaf/services/saf/smfsv/smfd/SmfUpgradeProcedure.cc
> b/osaf/services/saf/smfsv/smfd/SmfUpgradeProcedure.cc
> --- a/osaf/services/saf/smfsv/smfd/SmfUpgradeProcedure.cc
> +++ b/osaf/services/saf/smfsv/smfd/SmfUpgradeProcedure.cc
> @@ -1913,9 +1913,13 @@ SmfUpgradeProcedure::addStepModification
>          //Skip this for procedures in state completed, modifications will 
> not be
> needed if completed.
>          //This can happend if the cluster is rebooted and will fail if the 
> reboot is
> performed when the
>          //versioned types are removed i.e. during test traffic, if the types 
> was
> removed in campaign wrapup/complete section.
> -        if (getState() == SA_SMF_PROC_COMPLETED) {
> -                TRACE_LEAVE();
> -                return true;
> +        SmfUpgradeCampaign* ucamp = SmfCampaignThread::instance()-
> >campaign()->getUpgradeCampaign();
> +        if (ucamp->getProcExecutionMode() != SMF_BALANCED_MODE) {
> +                if (getState() == SA_SMF_PROC_COMPLETED) {
> +                        TRACE("Procedure is completed, skipping
> addStepModifications");
> +                        TRACE_LEAVE();
> +                        return true;
> +                }
>          }
> 
>       std::list < SmfTargetEntityTemplate * >::const_iterator it;
> @@ -3027,11 +3031,14 @@ SmfUpgradeProcedure::getImmStepsSingleSt
>       const SmfForAddRemove* forAddRemove = dynamic_cast<const
> SmfForAddRemove*>(scope);
>       const SmfForModify*    forModify    = dynamic_cast<const
> SmfForModify*>(scope);
> 
> -        if ((forAddRemove == NULL)&&(forModify == NULL)) {
> -             LOG_NO("SmfUpgradeProcedure::getImmStepsSingleStep:
> Procedure scope not found (SmfForAddRemove/forModify)");
> -                delete newStep;
> -             TRACE_LEAVE();
> -             return SA_AIS_ERR_NOT_EXIST;
> +        SmfUpgradeCampaign* ucamp = SmfCampaignThread::instance()-
> >campaign()->getUpgradeCampaign();
> +        if (ucamp->getProcExecutionMode() != SMF_BALANCED_MODE) {
[Lennart] Add comment saying why this is not needed if BALANCED_MODE

> +                if ((forAddRemove == NULL)&&(forModify == NULL)) {
> +                        LOG_NO("Procedure scope not found
> (SmfForAddRemove/forModify)");
> +                        delete newStep;
> +                        TRACE_LEAVE();
> +                        return SA_AIS_ERR_NOT_EXIST;
> +                }
>          }
> 
>       //----------------------------------------------------------

------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to