Hi Vu,

Ack from me.

Thanks,
Zoran

-----Original Message-----
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: den 27 december 2017 11:32
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen 
<vu.m.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: fix immnd restarted during SYNC finalize [#2749]

The call to saImmOiImplementerSet and saImmOiImplementerClear are allowed 
during sync.  Therefore, there is possibility the messages of these calls 
arrived at the sync-client after finalizeSync was sent from IMMND coord but 
before finalizeSync arrived at sync-client (over fevs).

In that case, the implementer record stored in sImplementerVector database will 
then be different with the implementer record in finalizeSync and this mismatch 
caused the IMMND sync-client restart with current implementation.

This ticket adds a check to ignore that implementer record in finalizeSync as 
it is obsolete instead of terminating the sync-client.
---
 src/imm/immnd/ImmModel.cc | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/src/imm/immnd/ImmModel.cc b/src/imm/immnd/ImmModel.cc index 
16fd4d8..fcd354e 100644
--- a/src/imm/immnd/ImmModel.cc
+++ b/src/imm/immnd/ImmModel.cc
@@ -19476,10 +19476,38 @@ SaAisErrorT 
ImmModel::finalizeSync(ImmsvOmFinalizeSync* req, bool isCoord,
                 "finalizeSync, ignoring",
                 info->mImplementerName.c_str(), info->mId);
             continue;
+          } else if (ii->id == 0 && ii->nodeId == 0 && ii->mds_dest == 0) {
+            /* Implementer set is requested just before finalizeSync, and it
+             * arrives on nodes after finalizeSync sends implementer info with
+             * all 0. So, ignore the implementer record in finalizeSync as it
+             * is obsolete.
+             */
+            LOG_WA("implementerSet '%s' id: %u has arrived "
+                   "after fynalizeSync broadcast and "
+                   "before finalizeSync arrived to the sync-client, ignoring",
+                   info->mImplementerName.c_str(), info->mId);
+            continue;
+          } else if (info->mId == 0 && info->mNodeId == 0 &&
+                     info->mMds_dest == 0) {
+            /* Implementer clear is requested just before finalizeSync, and it
+             * arrives on nodes after finalizeSync sends implementer info with
+             * old set. So, ignore the implementer record in finalizeSync as it
+             * is obsolete.
+             */
+            LOG_WA("implementerClear '%s' id: %u has arrived "
+                   "after fynalizeSync broadcast and "
+                   "before finalizeSync arrived to the sync-client, ignoring",
+                   info->mImplementerName.c_str(), ii->id);
+            continue;
           } else {
             LOG_WA(
-                "Invalid implementer detected at sync client by finalizeSync -"
-                " exiting");
+                "Mismatched implementer '%s' detected at sync client by"
+                "finalizeSync, info: id(%u, %u), nodeid(0x%x, 0x%x),"
+                "mdsdest(%" PRIx64", %" PRIx64 ") - exiting",
+                info->mImplementerName.c_str(),
+                info->mId, ii->id,
+                info->mNodeId, ii->nodeId,
+                (uint64_t)info->mMds_dest, (uint64_t)ii->mds_dest);
             err = SA_AIS_ERR_BAD_OPERATION;
             goto done;
           }
--
1.9.1


------------------------------------------------------------------------------
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
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to