Hi Minh,

Ack, code review only

Thanks,
Ravi

-----Original Message-----
From: Minh Chau [mailto:[email protected]] 
Sent: Tuesday, February 06, 2018 11:45 AM
To: [email protected]; [email protected]; 
[email protected]
Cc: [email protected]; Minh Chau <[email protected]>
Subject: [PATCH 1/1] amfnd: Discard new assignment while su is under failover 
[#2773]

When two errors happen to component and both escalates to a su failover. For 
the first su failover recovery, amfd will send new assignment to su. However, 
the second error happens just before the su receives new assignment. Currently, 
amfnd creates a susi record for the new assignment of first recovery, but amfnd 
will not issue csi callback to component since component is being failed. When 
the new assignment of second recovery comes, amfnd finds that the susi record 
had been created, and not process this new assignment. At the end, component is 
not getting any csi callback in both recovery.

This patch makes amfnd not to process the first new assignment while su is 
being failed over. This case is similar to the assignment removal is being 
discarded while su is under failover.
---
 src/amf/amfnd/su.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/amf/amfnd/su.cc b/src/amf/amfnd/su.cc index 21be12b..caa5356 
100644
--- a/src/amf/amfnd/su.cc
+++ b/src/amf/amfnd/su.cc
@@ -401,6 +401,12 @@ uint32_t avnd_evt_avd_info_su_si_assign_evh(AVND_CB *cb, 
AVND_EVT *evt) {
   cb->rcv_msg_id = info->msg_id;
 
   if (info->msg_act == AVSV_SUSI_ACT_ASGN) {
+    if (sufailover_in_progress(su) || sufailover_during_nodeswitchover(su) ||
+         cb->term_state == AVND_TERM_STATE_NODE_FAILOVER_TERMINATING){
+      TRACE_2("Discarding new assignment for '%s', flag:%x",
+          su->name.c_str(), su->flag);
+      goto done;
+    }
     /* SI rank and CSI capability (originally from SaAmfCtCsType)
      * was introduced in version 5 of the node director supported protocol.
      * If the protocol is older, take action */
--
2.7.4

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to