Thanks for assistance. I will follow the same.

-----Original Message-----
From: [email protected] [mailto:[email protected]] 
Sent: Tuesday, March 24, 2015 5:19 PM
To: [email protected]; [email protected]
Cc: [email protected]
Subject: [devel] [PATCH 1 of 1] amfd: reset admin op params during controller 
role swap [#1257]

 osaf/services/saf/amf/amfd/role.cc |  70 +++++++++++++++++++++++++++++--------
 1 files changed, 55 insertions(+), 15 deletions(-)


If two controller switchover occurs during lock operation on node, su etc; then 
unlock does gets timeout after try again.

AMF does not clear admin op params like invocation id and operation id during 
controller switchover.

Patch fixes the problem by clearing above mentioned params during controller 
swichover.

diff --git a/osaf/services/saf/amf/amfd/role.cc 
b/osaf/services/saf/amf/amfd/role.cc
--- a/osaf/services/saf/amf/amfd/role.cc
+++ b/osaf/services/saf/amf/amfd/role.cc
@@ -576,7 +576,57 @@ void avd_role_switch_ncs_su_evh(AVD_CL_C
        
        TRACE_LEAVE();
 }
+/**
+ * @brief  Resets admin op params for all admin op capable AMF entities during
+ *         when active AMFD gives implementer role during controller 
switchover.
+ */
+static void reset_admin_op_params_after_impl_clear()
+{
+       TRACE_ENTER();
+       //For ng.
+       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 (ng->admin_ng_pend_cbk.invocation != 0) {
+                       ng->admin_ng_pend_cbk.invocation = 0;
+                       ng->admin_ng_pend_cbk.admin_oper = 
static_cast<SaAmfAdminOperationIdT>(0);
+                       for (std::set<std::string>::const_iterator iter = 
ng->saAmfNGNodeList.begin();
+                                       iter != ng->saAmfNGNodeList.end(); 
++iter) {
+                               AVD_AVND *node = avd_node_get(*iter);
+                               node->admin_ng = NULL;
+                       }
+               }
+       }
+       //For Node.
+       for (std::map<uint32_t, AVD_AVND *>::const_iterator it = 
node_id_db->begin();
+                       it != node_id_db->end(); it++) {
+               AVD_AVND *node = it->second;
+               node->admin_node_pend_cbk.invocation = 0;
+               node->admin_node_pend_cbk.admin_oper = 
static_cast<SaAmfAdminOperationIdT>(0);
+       }
+       //For SI.
+       for (std::map<std::string, AVD_SI*>::const_iterator it = si_db->begin();
+                       it != si_db->end(); it++) {
+               AVD_SI *si = it->second;
+               si->invocation = 0;
+       }
+       //For SG.
+       for (std::map<std::string, AVD_SG*>::const_iterator it = sg_db->begin();
+                       it != sg_db->end(); it++) {
+               AVD_SG *sg = it->second;
+               sg->adminOp_invocationId = 0;
+               sg->adminOp = static_cast<SaAmfAdminOperationIdT>(0);
+       }
+       //For SU.
+       for (std::map<std::string, AVD_SU*>::const_iterator it = su_db->begin();
+                       it != su_db->end(); it++) {
+               AVD_SU *su = it->second;
+               su->pend_cbk.invocation = 0;
+                su->pend_cbk.admin_oper = 
+static_cast<SaAmfAdminOperationIdT>(0);
 
+       }
+       TRACE_LEAVE();
+}
 /*****************************************************************************
  * Function: avd_mds_qsd_role_func
  *
@@ -663,21 +713,11 @@ void avd_mds_qsd_role_evh(AVD_CL_CB *cb,
                cb->swap_switch = false;
                amfd_switch_qsd_actv(cb);
        }
-       /*Since this AMFD has given up implementor role, clear admin operation 
params  
-          for admin operation on nodegroup*/
-       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 (ng->admin_ng_pend_cbk.invocation != 0) {
-                       ng->admin_ng_pend_cbk.invocation = 0;
-                       ng->admin_ng_pend_cbk.admin_oper = 
static_cast<SaAmfAdminOperationIdT>(0);
-                       for (std::set<std::string>::const_iterator iter = 
ng->saAmfNGNodeList.begin();
-                                       iter != ng->saAmfNGNodeList.end(); 
++iter) {
-                               AVD_AVND *node = avd_node_get(*iter);
-                               node->admin_ng = NULL;
-                       }
-               }
-       }
+       /*
+          Since this AMFD has given up implementor role, clear admin operation 
params  
+          for admin operation on AMF entities.
+        */
+       reset_admin_op_params_after_impl_clear();
        TRACE_LEAVE();
 }
 

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored 
by Intel and developed in partnership with Slashdot Media, is your hub for all 
things parallel software development, from weekly thought leadership blogs to 
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to