Ack (Code review). Thanks -Nagu > -----Original Message----- > From: Praveen Malviya > Sent: 30 April 2015 12:33 > To: hans.nordeb...@ericsson.com; Nagendra Kumar > Cc: opensaf-devel@lists.sourceforge.net > Subject: [PATCH 1 of 1] amfd: ignore locked-in node during lock, shutdown > and unlock op on ng [#1356] > > osaf/services/saf/amf/amfd/nodegroup.cc | 18 ++++++++++++++++-- > osaf/services/saf/amf/amfd/sgproc.cc | 2 ++ > 2 files changed, 18 insertions(+), 2 deletions(-) > > > If a node is in lock-in state and lock, shutdown or unlock are initiated on > any > of its > nodegroup then there are two problems: > 1)During lock and shutdown operation on ng, locked-in admin state of node is > changed > to locked. > 2)During unlock operation on ng, locked-in admin state of node is changed to > unlocked. > In both the above cases locked-in state of node should remain intact. > > Patch ensures that a locked-in node remains untouched during lock, > shutdown and unlock > operation on any nodegroup of node. > > diff --git a/osaf/services/saf/amf/amfd/nodegroup.cc > b/osaf/services/saf/amf/amfd/nodegroup.cc > --- a/osaf/services/saf/amf/amfd/nodegroup.cc > +++ b/osaf/services/saf/amf/amfd/nodegroup.cc > @@ -771,19 +771,22 @@ void ng_unlock(AVD_AMF_NG *ng) > for (std::set<std::string>::const_iterator iter = ng- > >saAmfNGNodeList.begin(); > iter != ng->saAmfNGNodeList.end(); ++iter) { > AVD_AVND *node = avd_node_get(*iter); > + node->su_cnt_admin_oper = 0; > + if (node->saAmfNodeAdminState == > SA_AMF_ADMIN_LOCKED_INSTANTIATION) > + continue; > node_admin_state_set(node, SA_AMF_ADMIN_UNLOCKED); > if (node->node_info.member == false) { > LOG_NO("'%s' UNLOCK: CLM node is not member", > node->name.value); > continue; > } > - node->su_cnt_admin_oper = 0; > node->admin_ng = ng; > } > for (std::set<std::string>::const_iterator iter = ng- > >saAmfNGNodeList.begin(); > iter != ng->saAmfNGNodeList.end(); ++iter) { > AVD_AVND *node = avd_node_get(*iter); > if ((node->saAmfNodeOperState == > SA_AMF_OPERATIONAL_DISABLED) || > - (node->node_info.member == false)) > + (node->saAmfNodeAdminState == > SA_AMF_ADMIN_LOCKED_INSTANTIATION) || > + (node->node_info.member == false)) > continue; > for (AVD_SU *su = node->list_of_su; su != NULL; su = su- > >avnd_list_su_next) { > if (su->is_in_service() == true) { > @@ -796,6 +799,7 @@ void ng_unlock(AVD_AMF_NG *ng) > AVD_AVND *node = avd_node_get(*iter); > if ((node->saAmfNodeOperState == > SA_AMF_OPERATIONAL_DISABLED) || > (node->node_info.member == false) || > + (node->saAmfNodeAdminState == > SA_AMF_ADMIN_LOCKED_INSTANTIATION) || > (avd_cb->init_state == AVD_INIT_DONE)) > continue; > /* > @@ -867,12 +871,16 @@ static void ng_admin_op_cb(SaImmOiHandle > iter != ng->saAmfNGNodeList.end(); ++iter) { > AVD_AVND *node = avd_node_get(*iter); > node->su_cnt_admin_oper = 0; > + if (node->saAmfNodeAdminState == > SA_AMF_ADMIN_LOCKED_INSTANTIATION) > + continue; > node->admin_ng = ng; > node_admin_state_set(node, > SA_AMF_ADMIN_LOCKED); > } > for (std::set<std::string>::const_iterator iter = ng- > >saAmfNGNodeList.begin(); > iter != ng->saAmfNGNodeList.end(); ++iter) { > AVD_AVND *node = avd_node_get(*iter); > + if (node->saAmfNodeAdminState == > SA_AMF_ADMIN_LOCKED_INSTANTIATION) > + continue; > ng_node_lock_and_shutdown(node); > } > if (ng->node_oper_list.empty()) > @@ -916,12 +924,16 @@ static void ng_admin_op_cb(SaImmOiHandle > iter != ng->saAmfNGNodeList.end(); ++iter) { > AVD_AVND *node = avd_node_get(*iter); > node->su_cnt_admin_oper = 0; > + if (node->saAmfNodeAdminState == > SA_AMF_ADMIN_LOCKED_INSTANTIATION) > + continue; > node->admin_ng = ng; > node_admin_state_set(node, > SA_AMF_ADMIN_SHUTTING_DOWN); > } > for (std::set<std::string>::const_iterator iter = ng- > >saAmfNGNodeList.begin(); > iter != ng->saAmfNGNodeList.end(); ++iter) { > AVD_AVND *node = avd_node_get(*iter); > + if (node->saAmfNodeAdminState == > SA_AMF_ADMIN_LOCKED_INSTANTIATION) > + continue; > ng_node_lock_and_shutdown(node); > if (node->su_cnt_admin_oper == 0) > node_admin_state_set(node, > SA_AMF_ADMIN_LOCKED); > @@ -931,6 +943,8 @@ static void ng_admin_op_cb(SaImmOiHandle > for (std::set<std::string>::const_iterator iter = ng- > >saAmfNGNodeList.begin(); > iter != ng->saAmfNGNodeList.end(); > ++iter) { > AVD_AVND *node = avd_node_get(*iter); > + if (node->saAmfNodeAdminState == > SA_AMF_ADMIN_LOCKED_INSTANTIATION) > + continue; > node_admin_state_set(node, > SA_AMF_ADMIN_LOCKED); > } > ng_complete_admin_op(ng, SA_AIS_OK); > diff --git a/osaf/services/saf/amf/amfd/sgproc.cc > b/osaf/services/saf/amf/amfd/sgproc.cc > --- a/osaf/services/saf/amf/amfd/sgproc.cc > +++ b/osaf/services/saf/amf/amfd/sgproc.cc > @@ -369,6 +369,8 @@ static void process_su_si_response_for_n > for (std::set<std::string>::const_iterator iter = ng- > >saAmfNGNodeList.begin(); > iter != ng->saAmfNGNodeList.end(); ++iter) { > AVD_AVND *tmp_node = avd_node_get(*iter); > + if (tmp_node->saAmfNodeAdminState == > SA_AMF_ADMIN_LOCKED_INSTANTIATION) > + continue; > if (tmp_node->saAmfNodeAdminState != > SA_AMF_ADMIN_LOCKED) > flag = false; > }
------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel