Hi Nagu

I can't seem to cause a crash with (2).

Thanks for finding (1), I missed this use case where the nodegroup is 
also deleted in the same CCB. Will post another patch soon.

Thanks
Gary

On 08/09/15 20:50, Nagendra Kumar wrote:
> Amfd is crashing in the following scenarios #1 and #2:
>
> 1.
> immcfg -c SaAmfNode safAmfNode=PL-6,safAmfCluster=myAmfCluster -a 
> saAmfNodeSuFailoverMax=2 -a saAmfNodeSuFailOverProb=1200000000000 -a 
> saAmfNodeFailfastOnTerminationFailure=1 -a 
> saAmfNodeFailfastOnInstantiationFailure=0 -a 
> saAmfNodeClmNode=safNode=PL-6,safCluster=myClmCluster -a 
> saAmfNodeAutoRepair=1 -a saAmfNodeAdminState=3
> immcfg -c SaAmfNode safAmfNode=PL-7,safAmfCluster=myAmfCluster -a 
> saAmfNodeSuFailoverMax=2 -a saAmfNodeSuFailOverProb=1200000000000 -a 
> saAmfNodeFailfastOnTerminationFailure=1 -a 
> saAmfNodeFailfastOnInstantiationFailure=0 -a 
> saAmfNodeClmNode=safNode=PL-6,safCluster=myClmCluster -a 
> saAmfNodeAutoRepair=1 -a saAmfNodeAdminState=3
> immcfg -c SaAmfNodeGroup safAmfNodeGroup=Nagu,safAmfCluster=myAmfCluster -a 
> saAmfNGNodeList=safAmfNode=PL-6,safAmfCluster=myAmfCluster
> immcfg -m -a saAmfNGNodeList+=safAmfNode=PL-7,safAmfCluster=myAmfCluster   
> safAmfNodeGroup=Nagu,safAmfCluster=myAmfCluster
>
> immcfg
> immcfg -d safAmfNode=PL-6,safAmfCluster=myAmfCluster
> immcfg -d safAmfNodeGroup=Nagu,safAmfCluster=myAmfCluster
> immcfg --ccb-apply
>
> 2.
> immcfg -c SaAmfNode safAmfNode=PL-6,safAmfCluster=myAmfCluster -a 
> saAmfNodeSuFailoverMax=2 -a saAmfNodeSuFailOverProb=1200000000000 -a 
> saAmfNodeFailfastOnTerminationFailure=1 -a 
> saAmfNodeFailfastOnInstantiationFailure=0 -a 
> saAmfNodeClmNode=safNode=PL-6,safCluster=myClmCluster -a 
> saAmfNodeAutoRepair=1 -a saAmfNodeAdminState=3
> immcfg -c SaAmfNode safAmfNode=PL-7,safAmfCluster=myAmfCluster -a 
> saAmfNodeSuFailoverMax=2 -a saAmfNodeSuFailOverProb=1200000000000 -a 
> saAmfNodeFailfastOnTerminationFailure=1 -a 
> saAmfNodeFailfastOnInstantiationFailure=0 -a 
> saAmfNodeClmNode=safNode=PL-6,safCluster=myClmCluster -a 
> saAmfNodeAutoRepair=1 -a saAmfNodeAdminState=3
> immcfg -c SaAmfNodeGroup safAmfNodeGroup=Nagu,safAmfCluster=myAmfCluster -a 
> saAmfNGNodeList=safAmfNode=PL-6,safAmfCluster=myAmfCluster
> immcfg -m -a saAmfNGNodeList+=safAmfNode=PL-7,safAmfCluster=myAmfCluster   
> safAmfNodeGroup=Nagu,safAmfCluster=myAmfCluster
>
> immcfg
> immcfg -d safAmfNode=PL-6,safAmfCluster=myAmfCluster
> immcfg -m -a saAmfNGNodeList-=safAmfNode=PL-6,safAmfCluster=myAmfCluster 
> safAmfNodeGroup=Nagu,safAmfCluster=myAmfCluster
> immcfg --ccb-apply
>
> Thanks
> -Nagu
>
>> -----Original Message-----
>> From: Gary Lee [mailto:[email protected]]
>> Sent: 25 August 2015 11:54
>> To: Nagendra Kumar; [email protected]; Praveen Malviya;
>> [email protected]
>> Cc: [email protected]
>> Subject: [PATCH 4 of 4] amfd: allow node to be removed [#1458]
>>
>>   osaf/services/saf/amf/amfd/node.cc |  44
>> +++++++++++++++++++++++++++++++++----
>>   1 files changed, 39 insertions(+), 5 deletions(-)
>>
>>
>> allow node to be removed if it is also removed from all nodegroups
>>
>> diff --git a/osaf/services/saf/amf/amfd/node.cc
>> b/osaf/services/saf/amf/amfd/node.cc
>> --- a/osaf/services/saf/amf/amfd/node.cc
>> +++ b/osaf/services/saf/amf/amfd/node.cc
>> @@ -415,6 +415,7 @@
>>      AVD_SU *su;
>>      bool su_exist = false;
>>      CcbUtilOperationData_t *t_opData;
>> +    std::string node_name(Amf::to_string(&node->name));
>>
>>      TRACE_ENTER2("'%s'", opdata->objectName.value);
>>
>> @@ -460,12 +461,45 @@
>>      for (std::map<std::string, AVD_AMF_NG*>::const_iterator it =
>> nodegroup_db->begin();
>>                      it != nodegroup_db->end(); it++) {
>>              AVD_AMF_NG *ng = it->second;
>> +
>>              if (node_in_nodegroup(Amf::to_string(&(opdata-
>>> objectName)), ng) == true) {
>> -                    report_ccb_validation_error(opdata, "'%s' exists in"
>> -                                    " the nodegroup '%s'",
>> -                                    opdata->objectName.value, ng-
>>> name.value);
>> -                    rc = SA_AIS_ERR_BAD_OPERATION;
>> -                    goto done;
>> +                    // if the node is being removed from nodegroup too,
>> then it's OK
>> +                    TRACE("check if node is being deleted from
>> nodegroup '%s'", ng->name.value);
>> +                    t_opData = ccbutil_getCcbOpDataByDN(opdata-
>>> ccbId, &ng->name);
>> +
>> +                    if (t_opData == NULL) {
>> +                            TRACE("t_opData is NULL");
>> +                            report_ccb_validation_error(opdata, "'%s'
>> exists in"
>> +                                            " the nodegroup '%s'",
>> +                                            opdata->objectName.value,
>> ng->name.value);
>> +                            rc = SA_AIS_ERR_BAD_OPERATION;
>> +                            goto done;
>> +                    }
>> +
>> +                    const SaImmAttrModificationT_2 *mod = NULL;
>> +                    int i = 0;
>> +                    bool node_being_removed = false;
>> +                    while ((mod = t_opData-
>>> param.modify.attrMods[i++]) != NULL &&
>> +                            node_being_removed == false) {
>> +                            if (mod->modType ==
>> SA_IMM_ATTR_VALUES_DELETE) {
>> +                                    for (unsigned j = 0; j < mod-
>>> modAttr.attrValuesNumber; j++) {
>> +                                            if
>> (node_name.compare(Amf::to_string((SaNameT *)mod-
>>> modAttr.attrValues[j])) == 0) {
>> +                                                    // node is being
>> removed from nodegroup
>> +                                                    TRACE("node %s is
>> being removed from %s", node_name.c_str(), ng->name.value);
>> +                                                    node_being_removed
>> = true;
>> +                                                    break;
>> +                                            }
>> +                                    }
>> +                            }
>> +                    }
>> +
>> +                    if (node_being_removed == false) {
>> +                            report_ccb_validation_error(opdata, "'%s'
>> exists in"
>> +                                            " the nodegroup '%s'",
>> +                                            opdata->objectName.value,
>> ng->name.value);
>> +                            rc = SA_AIS_ERR_BAD_OPERATION;
>> +                            goto done;
>> +                    }
>>              }
>>      }
>>      opdata->userData = node;


------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to