File bsc#1206263-0002-Fix-scheduler-prevent-a-leftover-pending-monitor-fro.patch of Package pacemaker.27546

From 1d28036392d94001714d6ade8b4e00c0554a409d Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Fri, 2 Dec 2022 18:56:17 +0100
Subject: [PATCH 2/6] Fix: scheduler: prevent a leftover pending monitor from
 causing unexpected stop of other instances

As far as I can tell, the test `leftover-pending-monitor` exposes an
issue when deciding whether to add a `pe_order_runnable_left` flag for
the ordering related to a probe, where it's supposed to check whether
there's any parent resource with `running_on` rather than the instance
itself.

According to 7d37dc58d upon unpacking, with the leftover pending monitor
of stateful-1 on node-1, stateful-1:0 is exclusively assigned to node-1
and determined being stopped there. With the previous logic, given that
stateful-1:0 has no `running_on`, despite the fact that another instance
is already running on node-3, `pe_order_runnable_left` flag is enforced
for the ordering between `stateful-1:0_monitor_0` and
`promotable-1_start_0`. But then stateful-1:0_monitor_0 is marked
unrunnable because node-2 is pending, and then so is
promotable-1_start_0...
---
 lib/pacemaker/pcmk_sched_native.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: pacemaker-2.1.2+20211124.ada5c3b36/lib/pacemaker/pcmk_sched_native.c
===================================================================
--- pacemaker-2.1.2+20211124.ada5c3b36.orig/lib/pacemaker/pcmk_sched_native.c
+++ pacemaker-2.1.2+20211124.ada5c3b36/lib/pacemaker/pcmk_sched_native.c
@@ -2445,7 +2445,7 @@ native_create_probe(pe_resource_t * rsc,
     }
 
     if (!pcmk_is_set(probe->flags, pe_action_runnable)
-        && (rsc->running_on == NULL)) {
+        && (top->running_on == NULL)) {
         /* Prevent the start from occurring if rsc isn't active, but
          * don't cause it to stop if it was active already
          */
openSUSE Build Service is sponsored by