- Split-brain recovery in headless enable, IMMND may expected restart.
If AMFND not wait IMMND restart but reinit CLM, CLM callback trigger,
clm_to_amf_node() is called then AMFND stuck in init IMM OM causes delay
restart IMMND, delay resend node_up then AMFD will order reboot node.
- In clm_to_amf_node(), use old amf node name if immnd is down.
---
 src/amf/amfnd/avnd_cb.h | 1 +
 src/amf/amfnd/clc.cc    | 8 ++++++++
 src/amf/amfnd/clm.cc    | 7 ++++---
 src/amf/amfnd/main.cc   | 1 +
 4 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/amf/amfnd/avnd_cb.h b/src/amf/amfnd/avnd_cb.h
index 8b0cc2304..0fa0590ff 100644
--- a/src/amf/amfnd/avnd_cb.h
+++ b/src/amf/amfnd/avnd_cb.h
@@ -125,6 +125,7 @@ typedef struct avnd_cb_tag {
   SaTimeT scs_absence_max_duration;
   /* the timer for supervision of the absence of SC */
   AVND_TMR sc_absence_tmr;
+  bool immnd_down;
 } AVND_CB;
 
 #define AVND_CB_NULL ((AVND_CB *)0)
diff --git a/src/amf/amfnd/clc.cc b/src/amf/amfnd/clc.cc
index f78e1a707..f96f3b3a9 100644
--- a/src/amf/amfnd/clc.cc
+++ b/src/amf/amfnd/clc.cc
@@ -3333,6 +3333,14 @@ uint32_t avnd_comp_clc_cmd_execute(AVND_CB *cb, 
AVND_COMP *comp,
     // outcome of command is reported in comp_clc_resp_callback()
   }
 
+  if (comp->su->is_ncs &&
+      comp->name.find("safComp=IMMND,") != std::string::npos) {
+    if (cmd_type == AVND_COMP_CLC_CMD_TYPE_CLEANUP)
+      cb->immnd_down = true;
+    else if (cmd_type == AVND_COMP_CLC_CMD_TYPE_INSTANTIATE)
+      cb->immnd_down = false;
+  }
+
   TRACE_2("success");
   goto done;
 
diff --git a/src/amf/amfnd/clm.cc b/src/amf/amfnd/clm.cc
index 06eb229c7..7fef38daa 100644
--- a/src/amf/amfnd/clm.cc
+++ b/src/amf/amfnd/clm.cc
@@ -106,7 +106,7 @@ done:
 }
 
 static void clm_to_amf_node(void) {
-  SaAisErrorT error;
+  SaAisErrorT error = SA_AIS_ERR_UNAVAILABLE;
   SaImmSearchHandleT searchHandle;
   SaNameT amfdn, clmdn;
   SaImmSearchParametersT_2 searchParam;
@@ -122,9 +122,10 @@ static void clm_to_amf_node(void) {
   searchParam.searchOneAttr.attrValueType = SA_IMM_ATTR_SASTRINGT;
   searchParam.searchOneAttr.attrValue = &className;
 
-  error = saImmOmInitialize_cond(&immOmHandle, nullptr, &immVersion);
+  if (avnd_cb->immnd_down == false)
+    error = saImmOmInitialize_cond(&immOmHandle, nullptr, &immVersion);
   if (SA_AIS_OK != error) {
-    LOG_WA("saImmOmInitialize failed. Use previous value of nodeName.");
+    LOG_WA("Use previous value of nodeName %s", avnd_cb->amf_nodeName.c_str());
     osafassert(avnd_cb->amf_nodeName.empty() == false);
     goto done1;
   }
diff --git a/src/amf/amfnd/main.cc b/src/amf/amfnd/main.cc
index d7857fabe..cef0543e6 100644
--- a/src/amf/amfnd/main.cc
+++ b/src/amf/amfnd/main.cc
@@ -334,6 +334,7 @@ AVND_CB *avnd_cb_create() {
 
   cb->is_avd_down = true;
   cb->amfd_sync_required = false;
+  cb->immnd_down = false;
 
   // retrieve hydra configuration from IMM
   hydra_config_get(cb);
-- 
2.17.1



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

Reply via email to