Hi,
Please review, I would prefer to push it today.
Thanks
-Nagu
> -----Original Message-----
> From: Nagendra Kumar
> Sent: 14 April 2016 15:03
> To: [email protected]; Praveen Malviya;
> [email protected]; [email protected]
> Cc: [email protected]
> Subject: [devel] [PATCH 1 of 1] amfd: delete comp and its child objects at
> stdby amfd [#1761]
>
> osaf/services/saf/amf/amfd/su.cc | 42
> ++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 42 insertions(+), 0 deletions(-)
>
>
> If Comps are deleted at Act Amfd when Stdby Amfd has finished reading
> objects from Imm database, Stdby Amfd still has those Comps.
> Now, if SU containing these Comps are deleted, Act Amfd says Ok, but Stdby
> Amfd says it still has some Comps left in that SU to be deleted.
> Hence in apply callback, Stdby Amfd crashes.
> So, this patch makes sure that in this particular scenarios, if SU is being
> deleted and if there are some Comps and its child objects are still there,
> Stdby Amfd deletes them.
>
> diff --git a/osaf/services/saf/amf/amfd/su.cc
> b/osaf/services/saf/amf/amfd/su.cc
> --- a/osaf/services/saf/amf/amfd/su.cc
> +++ b/osaf/services/saf/amf/amfd/su.cc
> @@ -1819,6 +1819,48 @@ void su_ccb_apply_delete_hdlr(struct Ccb
> TRACE_ENTER2("'%s'", su->name.value);
>
> if (avd_cb->avail_state_avd != SA_AMF_HA_ACTIVE) {
> + /* Check if the comp and related objects are still left. This
> can
> + happen on Standby Amfd when it has just read the
> configuration
> + and before it becomes applier, Act Amfd deletes Comps.
> Those Comps
> + will be left out at Standby Amfd. Though this could be
> rare.*/
> + std::set<std::string> comp_list;
> + for (const auto& comp : su->list_of_comp)
> + comp_list.insert(Amf::to_string(&comp-
> >comp_info.name));
> + for (std::set<std::string>::const_iterator iter1 =
> comp_list.begin();
> + iter1 != comp_list.end(); ++iter1) {
> + AVD_COMP *comp = comp_db->find(*iter1);
> +
> + //Create a tmp database of compcstype.
> + std::set<std::string> compcstype_list;
> + for (std::map<std::string,
> AVD_COMPCS_TYPE*>::const_iterator it =
> + compcstype_db->begin();
> + it != compcstype_db->end(); it++) {
> + AVD_COMPCS_TYPE *compcstype = it-
> >second;
> +
> compcstype_list.insert(Amf::to_string(&compcstype->name));
> + }
> + TRACE("Standby Amfd, comp '%s' not deleted",
> +comp->comp_info.name.value);
> +
> + for (std::set<std::string>::const_iterator iter1 =
> compcstype_list.begin();
> + iter1 != compcstype_list.end();
> ++iter1) {
> + AVD_COMPCS_TYPE *compcstype =
> compcstype_db->find(*iter1);
> + if (compcstype->comp == comp) {
> + TRACE("Standby Amfd, compcstype
> '%s' not deleted",
> + compcstype-
> >name.value);
> + compcstype_db-
> >erase(Amf::to_string(&compcstype->name));
> + delete compcstype;
> + }
> + }
> + compcstype_list.clear();
> + /* Delete the Comp. */
> + struct CcbUtilOperationData opdata;
> + memset(&opdata.objectName, 0, sizeof(SaNameT));
> + memcpy(opdata.objectName.value, comp-
> >comp_info.name.value,
> + comp->comp_info.name.length);
> + opdata.objectName.length = comp-
> >comp_info.name.length;
> + comp_ccb_apply_delete_hdlr(&opdata);
> + }
> + comp_list.clear();
> +
> su->remove_from_model();
> delete su;
> goto done;
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers
> of your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> Opensaf-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel