Hi Hans N,

I tested with combination of SU/Node lock/locked-in with pres state inst 
fail/term fail.
So, when node is locked/locked-in, even if su goes into term fail, the alarm is 
not sent because the pres state becomes uninst before update_ass_state gets 
called. Hope this is ok.

Ack with the comments inlined with [Nagu] and the documentation need to be 
updated as well.


Thanks
-Nagu
> -----Original Message-----
> From: Hans Nordeback [mailto:hans.nordeb...@ericsson.com]
> Sent: 04 September 2015 19:20
> To: Praveen Malviya; Nagendra Kumar; gary....@dektech.com.au
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 1] amfd: Don't send alarm SI has no current active
> assignments if node is locked V2 [#1465]
> 
>  osaf/services/saf/amf/amfd/include/si.h |   2 ++
>  osaf/services/saf/amf/amfd/si.cc        |  23 +++++++++++++++++++----
>  osaf/services/saf/amf/amfd/siass.cc     |   3 +++
>  3 files changed, 24 insertions(+), 4 deletions(-)
> 
> 
> diff --git a/osaf/services/saf/amf/amfd/include/si.h
> b/osaf/services/saf/amf/amfd/include/si.h
> --- a/osaf/services/saf/amf/amfd/include/si.h
> +++ b/osaf/services/saf/amf/amfd/include/si.h
> @@ -109,6 +109,8 @@ public:
> 
>       bool alarm_sent; /* SI unassigned alarm has been sent */
> 
> +        struct avd_avnd_tag *si_on_node;     /*  the node on which this SI
> resides */
> +        AVD_SU *curr_su;                        /* The SU with the latest 
> assignment*/
>       void inc_curr_act_ass();
>       void dec_curr_act_ass();
>       void inc_curr_stdby_ass();
> diff --git a/osaf/services/saf/amf/amfd/si.cc
> b/osaf/services/saf/amf/amfd/si.cc
> --- a/osaf/services/saf/amf/amfd/si.cc
> +++ b/osaf/services/saf/amf/amfd/si.cc
> @@ -26,6 +26,7 @@
>  #include <csi.h>
>  #include <proc.h>
>  #include <si_dep.h>
> +#include <node.h>
> 
>  AmfDb<std::string, AVD_SI> *si_db = NULL;
> 
> @@ -320,7 +321,9 @@ AVD_SI::AVD_SI() :
>       list_of_sus_per_si_rank(NULL),
>       rankedsu_list_head(NULL),
>       invocation(0),
> -     alarm_sent(false)
> +     alarm_sent(false),
> +     si_on_node{nullptr},
> +     curr_su{nullptr}
>  {
>       memset(&name, 0, sizeof(SaNameT));
>       memset(&saAmfSvcType, 0, sizeof(SaNameT));
> @@ -1315,9 +1318,21 @@ void AVD_SI::update_ass_state()
> 
>               /* alarm & notifications */
>               if (saAmfSIAssignmentState ==
> SA_AMF_ASSIGNMENT_UNASSIGNED) {
> -                     avd_send_si_unassigned_alarm(&name);
> -                     alarm_sent = true;
> -                     m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb,
> this, AVSV_CKPT_SI_ALARM_SENT);
> +                     osafassert(si_on_node != nullptr);
> +                     osafassert(curr_su != nullptr);
> +                     if ((sg_of_si->sg_ncs_spec == true) &&
> +                         (sg_of_si->sg_type->saAmfSgtRedundancyModel ==
> SA_AMF_NO_REDUNDANCY_MODEL) &&
> +                         (curr_su->saAmfSUPresenceState !=
> SA_AMF_PRESENCE_INSTANTIATION_FAILED) &&
> +                         (curr_su->saAmfSUPresenceState !=
> SA_AMF_PRESENCE_TERMINATION_FAILED) &&
> +                         ((si_on_node->saAmfNodeAdminState ==
> SA_AMF_ADMIN_SHUTTING_DOWN) ||
> +                          (si_on_node->saAmfNodeAdminState ==
> SA_AMF_ADMIN_LOCKED) ||
> +                          (si_on_node->saAmfNodeAdminState ==
> SA_AMF_ADMIN_LOCKED_INSTANTIATION))) {
> +                             LOG_NO("Node is locked, no SI unassigned
> alarm will be sent");
> +                     } else {
> +                             avd_send_si_unassigned_alarm(&name);
> +                             alarm_sent = true;
> +
>       m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this,
> AVSV_CKPT_SI_ALARM_SENT);
> +                     }
>               }
>               else {
>                       avd_send_si_assigned_ntf(&name, oldState,
> saAmfSIAssignmentState);
> diff --git a/osaf/services/saf/amf/amfd/siass.cc
> b/osaf/services/saf/amf/amfd/siass.cc
> --- a/osaf/services/saf/amf/amfd/siass.cc
> +++ b/osaf/services/saf/amf/amfd/siass.cc
> @@ -166,6 +166,9 @@ AVD_SU_SI_REL *avd_susi_create(AVD_CL_CB
>       su_si->si = si;
>       su_si->su = su;
> 
> +     si->si_on_node = su->su_on_node;
> +     si->curr_su = su;
> +
>       /*
>        * Add the susi rel rec to the ordered si-list
>        */

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to