HI AndersBj,

Reviewed and tested the patch.

comments:
change variable  has to be set to true when any attributes are getting 
changed in schema upgrade.

more comments inline

Thanks,
Neel.

On Wednesday 16 July 2014 08:23 PM, Anders Bjornerstedt wrote:
>   osaf/services/saf/immsv/README            |  24 +++++++++++++++++++++---
>   osaf/services/saf/immsv/immnd/ImmModel.cc |   2 +-
>   2 files changed, 22 insertions(+), 4 deletions(-)
>
>
> This enhancement removes the restriction of not allowing a class schema change
> to add a default to an attribute definition. (Note: Removing a default is 
> still
> not allowed as it is inherrently not backwards compatible.)
>
> Only new instances of the class will get the default assigned when no value is
> provided for the attribute at object-create time.
>
> Old instances with a null-value for the attribute will still have a null-value
> for that attribute even after the schema change. A general rule for schema
> changes is that the immsv never alters the value of existing attributes as
> part of a schema change. Doing so would require the OI to be notified, which 
> is
> not realistic since the shcema change is not performed as a CCB.
>
> This feature is only functional after an upgrade to 4.5 has completed.
>
> diff --git a/osaf/services/saf/immsv/README b/osaf/services/saf/immsv/README
> --- a/osaf/services/saf/immsv/README
> +++ b/osaf/services/saf/immsv/README
> @@ -484,6 +484,10 @@ CHANGE of an existing attribute if it is
>        New instances of the class will get the new default,
>        old instances retain the old value.
>   
> +   * Adding default-value for an attribute (config or runtime).
> +     New instances of the class will get the new default,
> +     old instances retain the null value.
> +
>      * Adding 'multivalued' flag for an attribute (config or runtime).
>   
>      * Adding 'writable' flag for an attribute (config).
> @@ -494,7 +498,7 @@ CHANGE of an existing attribute if it is
>   
>   
>   All other changes, such as change of attribute type, removal of default,
> -addition of default, etc are not allowed.
> +etc are not allowed.
>   
>   There is no API change. The existing saImmOmClassCreate_2 call is used
>   to insert the new class version. The standard behavior is to reject
> @@ -1842,7 +1846,6 @@ not to create deadlock cycles between th
>   be resolved by the timeout of the synchronous admin-ops, so the problem 
> would be lack
>   of progress on some task, not a permanently hung set of processes.
>   
> -
>   Attribute 'longDnsAllowed' added to class 'OpensafImm' (4.5)
>   ===========================================================
>   https://sourceforge.net/p/opensaf/tickets/897
> @@ -1869,10 +1872,25 @@ The xml file should be used for upgradin
>   upgraded to OpenSAF 4.5 and that system must be capable of supporting long 
> DNs.
>   
>   
> +Allow schema change to add attribute default (4.5)
> +==================================================
> +https://sourceforge.net/p/opensaf/tickets/895
> +
> +The restriction of not allowing a default value to be added to an attribute 
> that
> +previously had no default, has been removed. Only new instances of the class 
> will
> +get the default assigned when no value is provided for the attribute at 
> object-create
> +time. Old instances with a null-value for the attribute will still have a 
> null-value
> +for that attribute even after the schema change. A general rule for schema 
> changes
> +is that the immsv never alters the value of existing attributes as part of a 
> schema
> +change. Doing so would require the OI to be notified, which is not realistic 
> since
> +the shcema change is not performed as a CCB.
> +This new feature is only available after an upgrade to OpensAF 4.5 has 
> completed.
> +
> +
>   Notes on upgrading from OpenSAF 4.[1,2,3,4] to OpenSAF 4.5
>   ==========================================================
>   Several enhancements in OpenSAF4.5 add new message types or add new imm 
> server states
> -for ccb handling (#798,  #799, #16). During a rolling upgrade from an 
> earlier OpenSAF
> +for ccb handling (#798,  #799, #16, #895). During a rolling upgrade from an 
> earlier OpenSAF
>   release to the 4.5 release there will be nodes executing the older release 
> concurrently
>   with nodes executing OpenSAF 4.5. Nodes executing the earlier release will 
> not
>   recognize new message types originating from nodes executing 4.5 and 
> messages from
> 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
> @@ -3727,7 +3727,7 @@ ImmModel::notCompatibleAtt(const std::st
>               }
>           }
>   
> -        if(oldAttr->mDefaultValue.empty() && 
> !newAttr->mDefaultValue.empty()) {
> +        if(oldAttr->mDefaultValue.empty() && !newAttr->mDefaultValue.empty() 
> && !protocol45Allowed()) {
>               LOG_NO("Impossible upgrade, attribute %s:%s adds default value",
>                   className.c_str(), attName.c_str());
>               return true;
if(oldAttr->mDefaultValue.empty() && !newAttr->mDefaultValue.empty()){
                 if(!protocol45Allowed()) {
                    LOG_NO("Impossible upgrade, attribute %s:%s adds 
default value",
                         className.c_str(), attName.c_str());
                     return true;
                 } else {
                         change=true;
                  }
         }




------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to