Hi Gary,
Please find one comment inline.

Thanks,
Praveen


On 08-Nov-16 2:29 PM, Gary Lee wrote:
>  osaf/services/saf/amf/amfd/include/su.h |   2 +-
>  osaf/services/saf/amf/amfd/sg.cc        |   2 +-
>  osaf/services/saf/amf/amfd/su.cc        |  24 +++++++++++++++++++++---
>  3 files changed, 23 insertions(+), 5 deletions(-)
>
>
> during standby cold sync, there may be a chance that
> SU creation was missed in between config read
> and being applier, so re-read config again.
>
> diff --git a/osaf/services/saf/amf/amfd/include/su.h 
> b/osaf/services/saf/amf/amfd/include/su.h
> --- a/osaf/services/saf/amf/amfd/include/su.h
> +++ b/osaf/services/saf/amf/amfd/include/su.h
> @@ -166,7 +166,7 @@ extern AmfDb<std::string, AVD_SU> *su_db
>   *
>   * @return SaAisErrorT
>   */
> -extern SaAisErrorT avd_su_config_get(const std::string& sg_name, AVD_SG *sg);
> +extern SaAisErrorT avd_su_config_get(const std::string& sg_name);
>
>  /**
>   * Class constructor, must be called before any other function
> diff --git a/osaf/services/saf/amf/amfd/sg.cc 
> b/osaf/services/saf/amf/amfd/sg.cc
> --- a/osaf/services/saf/amf/amfd/sg.cc
> +++ b/osaf/services/saf/amf/amfd/sg.cc
> @@ -455,7 +455,7 @@ SaAisErrorT avd_sg_config_get(const std:
>
>               sg_add_to_model(sg);
>
> -             if (avd_su_config_get(Amf::to_string(&dn), sg) != SA_AIS_OK) {
> +             if (avd_su_config_get(Amf::to_string(&dn)) != SA_AIS_OK) {
>                       error = SA_AIS_ERR_FAILED_OPERATION;
>                       goto done2;
>               }
> diff --git a/osaf/services/saf/amf/amfd/su.cc 
> b/osaf/services/saf/amf/amfd/su.cc
> --- a/osaf/services/saf/amf/amfd/su.cc
> +++ b/osaf/services/saf/amf/amfd/su.cc
> @@ -663,7 +663,7 @@ done:
>       TRACE_LEAVE();
>  }
>
> -SaAisErrorT avd_su_config_get(const std::string& sg_name, AVD_SG *sg)
> +SaAisErrorT avd_su_config_get(const std::string& sg_name)
>  {
>       SaAisErrorT error, rc;
>       SaImmSearchHandleT searchHandle;
> @@ -1813,10 +1813,28 @@ static void su_ccb_apply_modify_hdlr(str
>       int i = 0;
>       AVD_SU *su;
>       bool value_is_deleted;
> +     const std::string 
> object_name(osaf_extended_name_borrow(&opdata->objectName));
>
> -     TRACE_ENTER2("CCB ID %llu, '%s'", opdata->ccbId, 
> osaf_extended_name_borrow(&opdata->objectName));
> +     TRACE_ENTER2("CCB ID %llu, '%s'", opdata->ccbId, object_name.c_str());
>
> -     su = su_db->find(Amf::to_string(&opdata->objectName));
> +     su = su_db->find(object_name);
> +     if (su == nullptr) {
> +             // during standby cold sync, there may be a chance that
> +             // SU creation was missed in between config read
> +             // and being applier, so re-read config again.
> +             LOG_WA("CCB ID %llu, cannot find '%s'", opdata->ccbId, 
> object_name.c_str());
> +
> +             // get the SG
> +             std::string::size_type pos;
> +             pos = object_name.find(',');
> +             osafassert(pos != std::string::npos);
> +
> +             // re-read config
> +             avd_su_config_get(object_name.substr(pos + 1));
> +
> +             su = su_db->find(object_name);
> +             osafassert(su != nullptr);
> +     }
>
[Praveen] Above if block will be executed on both Active and standby 
AMFD. Issue reports problem on standby AMFD. Active AMFD should assert 
if does not have any SU which IMM has and for which CCB modify is 
initiated by user.



>       while ((attr_mod = opdata->param.modify.attrMods[i++]) != nullptr) {
>               /* Attribute value removed */
>

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to