Hi,

Khanh and I have a verbal talk what he found in his basic test (still crash
later)
I think the solution need to investigate more.

Best Regards,
ThuanTr

-----Original Message-----
From: Tran Thuan <thuan.t...@dektech.com.au> 
Sent: Monday, August 12, 2019 9:59 AM
To: 'khanh.h.dang' <khanh.h.d...@dektech.com.au>; lennart.l...@ericsson.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 1/1] smfd: set campaign state failed when error
msg is introduced [#3063]

Hi Khanh,

ACK from me (code review).

Best Regards,
ThuanTr

-----Original Message-----
From: khanh.h.dang <khanh.h.d...@dektech.com.au>
Sent: Tuesday, August 6, 2019 10:16 AM
To: lennart.l...@ericsson.com; thuan.t...@dektech.com.au
Cc: opensaf-devel@lists.sourceforge.net; khanh.h.dang
<khanh.h.d...@dektech.com.au>
Subject: [PATCH 1/1] smfd: set campaign state failed when error msg is
introduced [#3063]

With single step upgrade method, after a manual cluster reboot, campaign
status gets error but state remains EXECUTION_COMPLETED.
This change corrects the state of campaign in such case.
---
 src/smf/smfd/SmfCampaign.cc | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/smf/smfd/SmfCampaign.cc b/src/smf/smfd/SmfCampaign.cc index
6f51483..0dc2f0f 100644
--- a/src/smf/smfd/SmfCampaign.cc
+++ b/src/smf/smfd/SmfCampaign.cc
@@ -729,6 +729,23 @@ bool SmfCampaign::startProcedure(SmfUpgradeProcedure
*procedure) {
         "Start of procedure thread failed for " + procedure->getDn();
     LOG_ER("%s", error.c_str());
     SmfCampaignThread::instance()->campaign()->setError(error);
+
+    // When (merged to single step) campaign reachs EXECUTION_COMPLETED,
+    // if unexpected cluster reboot occurs, change state to
EXECUTION_FAILED
+    // for not leading to SMFD crash when trying to commit the campaign.
+    SmfUpgradeCampaign *p_uc = getUpgradeCampaign();
+    if ((p_uc->getProcExecutionMode() == SMF_MERGE_TO_SINGLE_STEP) &&
+        (SmfCampaignThread::instance()->campaign()->getState() ==
+        SA_SMF_CMPG_EXECUTION_COMPLETED)) {
+      std::string error =
+          "CAMP: campaign=" +
+          SmfCampaignThread::instance()->campaign()->getDn() +
+          " state: EXECUTION_COMPLETED => EXECUTION_FAILED " +
+          "due to unexpected cluster reboot.";
+      LOG_ER("%s", error.c_str());
+      SmfCampaignThread::instance()->campaign()->setState(
+          SA_SMF_CMPG_EXECUTION_FAILED);
+    }
     return false;
   }
   return true;
--
2.7.4




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



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

Reply via email to