On 31-Oct-14 1:22 PM, Hans Feldt wrote:
>
>
> On 10/30/2014 07:21 AM, praveen malviya wrote:
>>
>> Hi Hans,
>>
>> Referring to section 3.6.5.3 instead of schema for default value of
>> saAmfSIPrefActiveAssignments, the value should be adjusted to
>> saAmfSGNumPrefAssignedSUs or saAmfSGNumPrefInserviceSUs at the time of
>> creation of SI (in si.cc: si_create()).
>> This change is not present in this patch.
>> Is there any problem in adjustment in si.cc?
>
> If those attributes are not configured, they change value as SUs are
> added and removed (as in scaling the SG). Therefore it makes sense to
> have "getters" for these attributes that calculate their value. We
> anyway should strive for setters and getters.
>
> Then avd_sg_adjust_config() can be removed. The statement for checking
> FULLY_ASSIGNED in update_ass_state() can be simplified etc.
>

-The second condition in if statement introduces one problem, if a 
configuration sets saAmfSIPrefActiveAssignments equal to 
saAmfSGNumPrefAssignedSUs. In this case SI will be marked Fully Assigned 
as soon as it is assigned to first SI and other SUs are still in lock-in 
state.

This require removal if this comparison:
   (pref_active_assignments() == sg_of_si->num_pref_assigned_sus()))


-One more case has problem: If user himself wants to configure 
saAmfSIPrefActiveAssignments=1 (restrict the assignment to one SU only). 
AMF cannot distinguish if value 1 is set by the user or it is the 
default value given by IMM. Even maintaining 
saAmfSIPrefActiveAssignments_configured does not solve this problem.


Thanks,
Praveen

> Thanks,
> Hans
>
>
>>
>>
>> Thanks
>> Praveen
>>
>>
>>
>> On 28-Oct-14 6:18 PM, Hans Feldt wrote:
>>>   osaf/services/saf/amf/amfd/include/sg.h |   2 ++
>>>   osaf/services/saf/amf/amfd/sg.cc        |   7 +++++++
>>>   osaf/services/saf/amf/amfd/si.cc        |  13 ++++++++++---
>>>   3 files changed, 19 insertions(+), 3 deletions(-)
>>>
>>>
>>> In Nway-active, only one SU will be assigned if
>>> saAmfSIPrefActiveAssignments
>>> is not configured.
>>>
>>> The default value of saAmfSIPrefActiveAssignments is not set to
>>> saAmfSGNumPrefAssignedSUs according to 3.6.5.3.
>>>
>>> Set default value of saAmfSIPrefActiveAssignments to
>>> saAmfSGNumPrefAssignedSUs.
>>>
>>> diff --git a/osaf/services/saf/amf/amfd/include/sg.h
>>> b/osaf/services/saf/amf/amfd/include/sg.h
>>> --- a/osaf/services/saf/amf/amfd/include/sg.h
>>> +++ b/osaf/services/saf/amf/amfd/include/sg.h
>>> @@ -207,6 +207,8 @@ public:
>>>                         node. It should be reset to zero after
>>>                         use.*/
>>>
>>> +    uint32_t num_pref_assigned_sus() const;
>>> +
>>>       /**
>>>        * Set SG admin state, logs, checkpoints and sends notification
>>>        * @param state
>>> 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
>>> @@ -1736,6 +1736,9 @@ static void avd_verify_equal_ranked_su(A
>>>    * when all instances has been added to the model.
>>>    * For more info see sai-im-xmi-a.04.02.xml
>>>    */
>>> +/* TODO fix getters for saAmfSGNumPrefInserviceSUs and
>>> saAmfSGNumPrefAssignedSUs
>>> + * similar to AVD_SI::pref_active_assignments then this function
>>> would not be needed
>>> + */
>>>   void avd_sg_adjust_config(AVD_SG *sg)
>>>   {
>>>       // SUs in an SG are equal, only need to look at the first one
>>> @@ -1880,3 +1883,7 @@ bool sg_stable_after_lock_in_or_unlock_i
>>>
>>>       return true;
>>>   }
>>> +
>>> +uint32_t AVD_SG::num_pref_assigned_sus() const {
>>> +    return saAmfSGNumPrefAssignedSUs;
>>> +}
>>> diff --git a/osaf/services/saf/amf/amfd/si.cc
>>> b/osaf/services/saf/amf/amfd/si.cc
>>> --- a/osaf/services/saf/amf/amfd/si.cc
>>> +++ b/osaf/services/saf/amf/amfd/si.cc
>>> @@ -1233,8 +1233,11 @@ void AVD_SI::update_ass_state()
>>>               newState = SA_AMF_ASSIGNMENT_UNASSIGNED;
>>>           } else {
>>>               osafassert(saAmfSINumCurrStandbyAssignments == 0);
>>> -            osafassert(saAmfSINumCurrActiveAssignments <=
>>> saAmfSIPrefActiveAssignments);
>>> -            if (saAmfSINumCurrActiveAssignments ==
>>> saAmfSIPrefActiveAssignments)
>>> +            osafassert(saAmfSINumCurrActiveAssignments <=
>>> pref_active_assignments());
>>> +            // TODO sg-num_pref_assigned_sus() should return number
>>> of in-service
>>> +            // SUs then the second statement can be removed!
>>> +            if ((saAmfSINumCurrActiveAssignments ==
>>> pref_active_assignments()) ||
>>> +                (pref_active_assignments() ==
>>> sg_of_si->num_pref_assigned_sus()))
>>>                   newState = SA_AMF_ASSIGNMENT_FULLY_ASSIGNED;
>>>               else
>>>                   newState = SA_AMF_ASSIGNMENT_PARTIALLY_ASSIGNED;
>>> @@ -1381,7 +1384,11 @@ void AVD_SI::set_si_switch(AVD_CL_CB *cb
>>>
>>>   uint32_t AVD_SI::pref_active_assignments() const
>>>   {
>>> -    return saAmfSIPrefActiveAssignments;
>>> +    if (saAmfSIPrefActiveAssignments == 1) {
>>> +        // Default value: the preferred number of assigned service
>>> units.
>>> +        return sg_of_si->num_pref_assigned_sus();
>>> +    } else
>>> +        return saAmfSIPrefActiveAssignments;
>>>   }
>>>
>>>   uint32_t AVD_SI::curr_active_assignments() const
>>>
>>> ------------------------------------------------------------------------------
>>>
>>>
>>> _______________________________________________
>>> Opensaf-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/opensaf-devel
>>>
>>

------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to