Blame SOURCES/017-pending-notify.patch

8ba105
From 8e9a9d1aa3cceb8f310ed3db9b31b2eab9490330 Mon Sep 17 00:00:00 2001
8ba105
From: Ken Gaillot <kgaillot@redhat.com>
8ba105
Date: Thu, 19 Apr 2018 17:17:51 -0500
8ba105
Subject: [PATCH] Fix: libcrmcommon: don't record pending notify actions as
8ba105
 completed
8ba105
8ba105
... especially relevant now that record-pending defaults to true.
8ba105
---
8ba105
 lib/common/operations.c | 14 ++++++++++----
8ba105
 1 file changed, 10 insertions(+), 4 deletions(-)
8ba105
8ba105
diff --git a/lib/common/operations.c b/lib/common/operations.c
8ba105
index 4afef80..3ca5939 100644
8ba105
--- a/lib/common/operations.c
8ba105
+++ b/lib/common/operations.c
8ba105
@@ -1,5 +1,5 @@
8ba105
 /*
8ba105
- * Copyright (C) 2004-2017 Andrew Beekhof <andrew@beekhof.net>
8ba105
+ * Copyright 2004-2018 Andrew Beekhof <andrew@beekhof.net>
8ba105
  *
8ba105
  * This source code is licensed under the GNU Lesser General Public License
8ba105
  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8ba105
@@ -513,9 +513,15 @@ create_operation_update(xmlNode * parent, lrmd_event_data_t * op, const char * c
8ba105
         CRM_LOG_ASSERT(n_task != NULL);
8ba105
         op_id = generate_notify_key(op->rsc_id, n_type, n_task);
8ba105
 
8ba105
-        /* these are not yet allowed to fail */
8ba105
-        op->op_status = PCMK_LRM_OP_DONE;
8ba105
-        op->rc = 0;
8ba105
+        if (op->op_status != PCMK_LRM_OP_PENDING) {
8ba105
+            /* Ignore notify errors.
8ba105
+             *
8ba105
+             * @TODO We really should keep the actual result here, and ignore it
8ba105
+             * when processing the CIB diff.
8ba105
+             */
8ba105
+            op->op_status = PCMK_LRM_OP_DONE;
8ba105
+            op->rc = 0;
8ba105
+        }
8ba105
 
8ba105
     } else if (did_rsc_op_fail(op, target_rc)) {
8ba105
         op_id = generate_op_key(op->rsc_id, "last_failure", 0);
8ba105
-- 
8ba105
1.8.3.1
8ba105