File bsc#1181744-0002-Fix-fencer-update-outdated-pending-operations-accord.patch of Package pacemaker.20188

From e91619cf25cdbbfe48c0b5dccdbe2c972af2ee55 Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Fri, 12 Feb 2021 18:25:58 +0100
Subject: [PATCH 2/4] Fix: fencer: update outdated pending operations according
 to returned ones from remote peer history

If a fencer had a pending fencing operation in the history but somehow
was not reachable when the fencing operation returned, the pending
operation would remain outdated and get stuck in the history.

The solution here is to broadcast returned fencing operations and update
outdated pending ones in the history.
---
 daemons/fenced/fenced_history.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

Index: pacemaker-2.0.5+20201202.ba59be712/daemons/fenced/fenced_history.c
===================================================================
--- pacemaker-2.0.5+20201202.ba59be712.orig/daemons/fenced/fenced_history.c
+++ pacemaker-2.0.5+20201202.ba59be712/daemons/fenced/fenced_history.c
@@ -363,7 +363,18 @@ stonith_merge_in_history_list(GHashTable
             g_hash_table_lookup(stonith_remote_op_list, op->id);
 
         if (stored_op) {
-            continue; // Skip existent (@TODO state-merging might be desirable)
+            if (stored_op->state != st_failed
+                && stored_op->state != st_done
+                && (op->state == st_failed || op->state == st_done)) {
+                    crm_debug("Updating outdated pending operation %.8s "
+                              "(state=%d) according to the one (state=%d) from "
+                              "remote peer history",
+                              op->id, stored_op->state,
+                              op->state);
+
+            } else {
+                continue; // Skip existent
+            }
         }
 
         updated = TRUE;
openSUSE Build Service is sponsored by