On 01-Feb-17 2:30 PM, Gary Lee wrote: > Hi Praveen > > What if the user reboots the cluster, after modifying > saAmfSIPrefActiveAssignments? > I guess you are talking about the case that a user modifies to 1 in 5.2 release and cluster reboots. But I think cluster reboots are done mainly for the cases of upgrades which are not frequently done. For upgrades, CCB modification can be part of campaign itself.
What I am getting is all the cases cannot be handled here in AMFD because of schema issue. User will have to take some pain depending upon the use case. Also I guess N-way active red model will not be used for keeping SI assigned to one SU. What do you think? Thanks, Praveen > Thanks > > -----Original Message----- > From: praveen malviya <[email protected]> > Organization: Oracle Corporation > Date: Wednesday, 1 February 2017 at 5:31 pm > To: gary <[email protected]>, <[email protected]>, > <[email protected]>, <[email protected]> > Cc: <[email protected]> > Subject: Re: [PATCH 1 of 1] amfd: fix default value of > saAmfSIPrefActiveAssignments [1190] > > > > On 01-Feb-17 11:20 AM, Gary Lee wrote: > > Hi Praveen > > > > Ack – I think we should make it clear in the PR doc that the default > will be 1 if they leave out ‘saAmfSIPrefActiveAssignments‘ when creating the > SI. If they want it to default to saAmfSGNumPrefAssignedSUs, they must create > the SI with ‘saAmfSIPrefActiveAssignments’ set to blank. > > > This ticket is to honour saAmfSGNumPrefAssignedSUs from now on-wards in > both the cases when it was not configured while creating the SI or when > it is set to blank. > > I think, I will have to document in this way: > 1) If saAmfSIPrefActiveAssignments is not configured while creating an > SI, then AMF will use saAmfSGNumPrefAssignedSUs as default value. > 2) If SI is already configured then saAmfSIPrefActiveAssignments can be > adjusted to default value saAmfSGNumPrefAssignedSUs by setting > saAmfSIPrefActiveAssignments to blanck via CCB operation. > > In 1) immlist will still show value as 1, but AMF will adhere to > saAmfSGNumPrefAssignedSUs. This cannot be corrected because imm.xml > contains a default based on old schema definition: > <attr> > <name>saAmfSIPrefActiveAssignments</name> > <type>SA_UINT32_T</type> > <category>SA_CONFIG</category> > <flag>SA_WRITABLE</flag> > <default-value>1</default-value> > </attr> > So when AMFD reads it from IMM, it does not know whether user has > configured it to 1 or it is IMM that is giving 1 as default value to > AMFD. With this enhancement, on seeing 1 AMFD will consider that use has > not configured it and will adhere to default value > saAmfSGNumPrefAssignedSUs. > A old user can still make everything consistent for its old application > my the provision of making saAmfSIPrefActiveAssignments to 1 using CCB > Modify operation. If user performs this CCB change then in function > pref_active_assignments() flag saAmfSIPrefActiveAssignments_configured > will take care of user's choice. > > > Thanks, > Praveen > > Thanks > > Gary > > > > On 1/2/17, 4:08 pm, "praveen malviya" <[email protected]> > wrote: > > > > > > On 01-Feb-17 9:45 AM, Gary Lee wrote: > > > Hi Praveen > > > > > > saAmfSIPrefActiveAssignments defaults to 1 in the schema. I guess > saAmfSGNumPrefAssignedSUs only becomes default, if the user deliberately > sets saAmfSIPrefActiveAssignments to “”? > > > > > > > In section 3.6.5, default value of saAmfSIPrefActiveAssignments is > > mentioned as saAmfSGNumPrefAssignedSUs and same is mentioned in > > SAI-IM-XMI-A.04.02.errata.xml. > > > > Yes, a user can make saAmfSGNumPrefAssignedSUs make default by above > > mentioned way. Also while configuring SG if the attrbitue itself is > > ignored then also AMFD will adjust to default value. > > > > Thanks > > Praveen > > > > > > > Thanks > > > Gary > > > > > > On 16/1/17, 8:56 pm, "[email protected]" > <[email protected]> wrote: > > > > > > src/amf/amfd/sg.cc | 4 ++++ > > > src/amf/amfd/sg.h | 1 + > > > src/amf/amfd/si.cc | 35 ++++++++++++++++++++++++++--------- > > > src/amf/amfd/si.h | 5 +++++ > > > 4 files changed, 36 insertions(+), 9 deletions(-) > > > > > > > > > AMF spec specifies two different default values for > saAmfSIPrefActiveAssignments in: > > > 1)section 3.6.5: Default is preferred number of assigned > service > > > units i.e saAmfSGNumPrefAssignedSUs. > > > 2)section 8.11: default value as 1. > > > Currently if a user does not configure any value for this > attribute, then > > > IMM sets default value to 1. Because of this when SG is > unlocked or lots > > > of SUs are unlocked, AMF assigns SI to only one SU. For other > SUs to get > > > assignment for this SI, a CCB modification is needed. This > causes problem > > > in scaling up application as CCB modification needs to be > performed each time > > > a SU is added. > > > > > > This enhancement honours default value given in section > 3.6.5. So the default > > > value of saAmfSIPrefActiveAssignments will be > saAmfSGNumPrefAssignedSUs. > > > > > > Note related to upgrade (AMF PR doc will be updated for this) > : > > > If any N-Way Active application is running with default value > of > > > saAmfSIPrefActiveAssignments=1 for a SI then SI is assigned > to only > > > one SU. After upgrade to this release, default value is now > changed to > > > saAmfSGNumPrefAssignedSUs. So application will see more > assigned SUs for > > > this SI. For such an application, old behaviour can still be > achieved by > > > modifying the default value of saAmfSIPrefActiveAssignments > to 1 using CCB > > > operation only once. This should be done as soon as the first > system > > > controller is upgraded to this release in standby role. In > this way Standby > > > controller will remember the user definition and it will > honor it when it > > > takes the active role. > > > This upgrade provision is maintained for two releases only > and it can be removed when 5.2 is no longer > > > maintained. > > > > > > diff --git a/src/amf/amfd/sg.cc b/src/amf/amfd/sg.cc > > > --- a/src/amf/amfd/sg.cc > > > +++ b/src/amf/amfd/sg.cc > > > @@ -2322,4 +2322,8 @@ bool AVD_SG::any_assignment_assigned() { > > > return pending; > > > } > > > > > > +uint32_t AVD_SG::pref_assigned_sus() const { > > > + //If not configured, AMFD has already adjusted to default > value in avd_sg_adjust_config(). > > > + return saAmfSGNumPrefAssignedSUs; > > > +} > > > > > > diff --git a/src/amf/amfd/sg.h b/src/amf/amfd/sg.h > > > --- a/src/amf/amfd/sg.h > > > +++ b/src/amf/amfd/sg.h > > > @@ -428,6 +428,7 @@ public: > > > //Runtime calculates value of > saAmfSGNumCurrNonInstantiatedSpareSUs; > > > uint32_t curr_non_instantiated_spare_sus() const; > > > bool is_middleware() const {return sg_ncs_spec ? true : > false;} > > > + uint32_t pref_assigned_sus() const; > > > > > > private: > > > // disallow copy and assign, TODO(hafe) add common > macro for this > > > diff --git a/src/amf/amfd/si.cc b/src/amf/amfd/si.cc > > > --- a/src/amf/amfd/si.cc > > > +++ b/src/amf/amfd/si.cc > > > @@ -601,8 +601,9 @@ static AVD_SI *si_create(const std::stri > > > if > (immutil_getAttr(const_cast<SaImmAttrNameT>("saAmfSIPrefActiveAssignments"), > attributes, 0, > > > &si->saAmfSIPrefActiveAssignments) > != SA_AIS_OK) { > > > > > > - /* Empty, assign default value */ > > > + /* Empty, assign default value. Check note in > functoin pref_active_assignments() */ > > > si->saAmfSIPrefActiveAssignments = 1; > > > + si->saAmfSIPrefActiveAssignments_configured = > false; > > > } > > > > > > if > (immutil_getAttr(const_cast<SaImmAttrNameT>("saAmfSIPrefStandbyAssignments"), > attributes, 0, > > > @@ -1094,8 +1095,9 @@ void AVD_SI::adjust_si_assignments(const > > > } > > > sisu = sisu->si_next; > > > } > > > - /* Change the SG FSM to > AVD_SG_FSM_SG_REALIGN SG to Stable state */ > > > - m_AVD_SET_SG_FSM(avd_cb, sg_of_si, > AVD_SG_FSM_SG_REALIGN); > > > + /* Change the SG FSM to > AVD_SG_FSM_SG_REALIGN if assignment is sent.*/ > > > + if (i > 0) > > > + m_AVD_SET_SG_FSM(avd_cb, > sg_of_si, AVD_SG_FSM_SG_REALIGN); > > > } > > > } > > > if( sg_of_si->sg_redundancy_model == > SA_AMF_N_WAY_REDUNDANCY_MODEL ) { > > > @@ -1161,8 +1163,16 @@ static void > si_ccb_apply_modify_hdlr(Ccb > > > > > > if (value_is_deleted) { > > > mod_pref_assignments = 1; > > > + > si->saAmfSIPrefActiveAssignments_configured = false; > > > } else { > > > mod_pref_assignments = > *((SaUint32T *)attr_mod->modAttr.attrValues[0]); > > > + //A user is intentionally > setting it to 1. Remember this choice. > > > + if (mod_pref_assignments == 1) > { > > > + > TRACE("saAmfSIPrefActiveAssignments is configured to 1."); > > > + > si->saAmfSIPrefActiveAssignments_configured = true; > > > + } else { > > > + > si->saAmfSIPrefActiveAssignments_configured = false; > > > + } > > > } > > > > > > if (avd_cb->avail_state_avd != > SA_AMF_HA_ACTIVE) { > > > @@ -1172,7 +1182,11 @@ static void > si_ccb_apply_modify_hdlr(Ccb > > > > > > /* Check if we need to readjust the SI > assignments as PrefActiveAssignments > > > got changed */ > > > - if ( mod_pref_assignments == > si->saAmfSINumCurrActiveAssignments ) { > > > + if (value_is_deleted) { > > > + TRACE("Assignments will be > adjusted to default value saAmfSGNumPrefAssignedSUs"); > > > + > si->saAmfSIPrefActiveAssignments = mod_pref_assignments; > > > + > si->adjust_si_assignments(si->pref_active_assignments()); > > > + } else if ( mod_pref_assignments == > si->saAmfSINumCurrActiveAssignments ) { > > > TRACE("Assignments are equal > updating the SI status "); > > > > si->saAmfSIPrefActiveAssignments = mod_pref_assignments; > > > } else if (mod_pref_assignments > > si->saAmfSINumCurrActiveAssignments) { > > > @@ -1296,8 +1310,7 @@ void AVD_SI::update_ass_state() > > > newState = SA_AMF_ASSIGNMENT_UNASSIGNED; > > > } else { > > > > osafassert(saAmfSINumCurrStandbyAssignments == 0); > > > - > osafassert(saAmfSINumCurrActiveAssignments <= saAmfSIPrefActiveAssignments); > > > - if (saAmfSINumCurrActiveAssignments == > saAmfSIPrefActiveAssignments) > > > + if (saAmfSINumCurrActiveAssignments == > pref_active_assignments()) > > > newState = > SA_AMF_ASSIGNMENT_FULLY_ASSIGNED; > > > else > > > newState = > SA_AMF_ASSIGNMENT_PARTIALLY_ASSIGNED; > > > @@ -1435,9 +1448,13 @@ void AVD_SI::set_si_switch(AVD_CL_CB > *cb > > > m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(cb, this, > AVSV_CKPT_SI_SWITCH); > > > } > > > > > > -uint32_t AVD_SI::pref_active_assignments() const > > > -{ > > > - return saAmfSIPrefActiveAssignments; > > > +uint32_t AVD_SI::pref_active_assignments() const { > > > + if ((saAmfSIPrefActiveAssignments == 1) && > (saAmfSIPrefActiveAssignments_configured == false)) { > > > + /* This means user has not configured any value not even > 1. Return default value which is > > > + preferred number of assigned SUs, > saAmfSGNumPrefAssignedSUs.*/ > > > + return sg_of_si->pref_assigned_sus(); > > > + } else > > > + return saAmfSIPrefActiveAssignments; > > > } > > > > > > uint32_t AVD_SI::curr_active_assignments() const > > > diff --git a/src/amf/amfd/si.h b/src/amf/amfd/si.h > > > --- a/src/amf/amfd/si.h > > > +++ b/src/amf/amfd/si.h > > > @@ -107,6 +107,11 @@ public: > > > SaInvocationT invocation; > > > > > > bool alarm_sent; /* SI unassigned alarm has been sent */ > > > + bool saAmfSIPrefActiveAssignments_configured; /* To > remember if user has configured as 1. > > > + As of > now this variable is maintained for > > > + > supporting upgrade path. It will be removed > > > + when > 5.2 longer is no maintained. > > > + */ > > > > > > void inc_curr_act_ass(); > > > void dec_curr_act_ass(); > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
