Ack, code review only/Thanks HansN

-----Original Message-----
From: praveen.malv...@oracle.com [mailto:praveen.malv...@oracle.com] 
Sent: den 28 oktober 2015 13:33
To: Hans Nordebäck; nagendr...@oracle.com; Gary Lee
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] amfd: adjust NPI app configuration during unlock-in op 
[#1564]

 osaf/services/saf/amf/amfd/node.cc      |  3 ++-
 osaf/services/saf/amf/amfd/nodegroup.cc |  1 +
 osaf/services/saf/amf/amfd/sg.cc        |  1 +
 3 files changed, 4 insertions(+), 1 deletions(-)


SG went to unstable for unlock operation on locked SG.

This issue is applicable for NPI apps only.
For a NPI SU, only one SI can be assigned to the whole SU. Remaining SIs if 
configured will remain unassigned. Earliar creating a SU in the system was 
allowed only in LOCK_IN state. So in typical steps, a user used to configure a 
SU in the system in LOCK_IN state and after this user performs unlock-in 
operation on the SU. During this UNLOCK_IN opearation, AMF adjusts SG 
configuration attributes for example for NPI application it adjusts the value 
of saAmfSGMaxActiveSIsperSU and saAmfSGMaxStandbySIsperSU. So issue will not be 
reproducible in this way.
Now from 4.5 release creation of SU is allowed if either node or sg is in 
LOCK_IN state. In this reported issue SUs are created by keeping SG in LOCK_IN 
state.

Patch fixes the problem by adjusting the SG attributes during unlock-in 
operation on SG, Node or NG.

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
@@ -892,7 +892,8 @@ uint32_t node_admin_unlock_instantiation
                                                LOG_WA("Failed Instantiation 
'%s'", su->name.value);
                                        }
                                }
-                       } 
+                       } else
+                               avd_sg_adjust_config(su->sg_of_su);
                }
        }
 
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
@@ -940,6 +940,7 @@ static void ng_admin_unlock_inst(AVD_AMF
                                continue;
 
                        su_try_inst = 0;
+                       avd_sg_adjust_config(sg);
                        for (const auto& su : sg->list_of_su) {
                                //Continue if this SU is not hosted on the Node 
of NG.
                                if 
(node_in_nodegroup(Amf::to_string(&su->su_on_node->name), ng) == false) 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
@@ -1382,6 +1382,7 @@ static void sg_admin_op_cb(SaImmOiHandle
                avd_sg_admin_state_set(sg, SA_AMF_ADMIN_LOCKED);
 
                if ((sg->list_of_su.empty() == false) && 
(sg->first_su()->saAmfSUPreInstantiable == false)) {
+                       avd_sg_adjust_config(sg);
                        avd_saImmOiAdminOperationResult(immOiHandle, 
invocation, SA_AIS_OK);
                        goto done;
                }

------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to