File pacemaker-pengine-allow-all-resources-to-stop-prior-to-probes-completing.patch of Package pacemaker.14737

commit 3a34feda66fea579f86aac6b525fddc4b68d00ff
Author: Andrew Beekhof <andrew@beekhof.net>
Date:   Thu Nov 2 13:36:28 2017 +1100

    Fix: PE: Allow all resources to stop prior to probes completing
    
    - Avoids transition loops, particularly with bundles
    - Fix docker/remote probe ordering for bundles

Index: pacemaker-1.1.16+20170320.77ea74d/pengine/graph.c
===================================================================
--- pacemaker-1.1.16+20170320.77ea74d.orig/pengine/graph.c
+++ pacemaker-1.1.16+20170320.77ea74d/pengine/graph.c
@@ -176,13 +176,34 @@ rsc_expand_action(action_t * action)
 static enum pe_graph_flags
 graph_update_action(action_t * first, action_t * then, node_t * node,
                     enum pe_action_flags first_flags, enum pe_action_flags then_flags,
-                    enum pe_ordering type)
+                    action_wrapper_t *order)
 {
     enum pe_graph_flags changed = pe_graph_none;
+    enum pe_ordering type = order->type;
     gboolean processed = FALSE;
 
     /* TODO: Do as many of these in parallel as possible */
 
+    if(is_set(type, pe_order_implies_then_on_node)) {
+        /* Normally we want the _whole_ 'then' clone to
+         * restart if 'first' is restarted, so then->node is
+         * needed.
+         *
+         * However for unfencing, we want to limit this to
+         * instances on the same node as 'first' (the
+         * unfencing operation), so first->node is supplied.
+         *
+         * Swap the node, from then on we can can treat it
+         * like any other 'pe_order_implies_then'
+         */
+
+        clear_bit(type, pe_order_implies_then_on_node);
+        set_bit(type, pe_order_implies_then);
+        node = first->node;
+    }
+
+    clear_bit(first_flags, pe_action_pseudo);
+
     if (type & pe_order_implies_then) {
         processed = TRUE;
         if (then->rsc) {
@@ -575,29 +596,8 @@ update_action(action_t * then)
              *   constraint to instances on the supplied node
              *
              */
-            int otype = other->type;
             node_t *node = then->node;
-
-            if(is_set(otype, pe_order_implies_then_on_node)) {
-                /* Normally we want the _whole_ 'then' clone to
-                 * restart if 'first' is restarted, so then->node is
-                 * needed.
-                 *
-                 * However for unfencing, we want to limit this to
-                 * instances on the same node as 'first' (the
-                 * unfencing operation), so first->node is supplied.
-                 *
-                 * Swap the node, from then on we can can treat it
-                 * like any other 'pe_order_implies_then'
-                 */
-
-                clear_bit(otype, pe_order_implies_then_on_node);
-                set_bit(otype, pe_order_implies_then);
-                node = first->node;
-            }
-            clear_bit(first_flags, pe_action_pseudo);
-
-            changed |= graph_update_action(first, then, node, first_flags, then_flags, otype);
+            changed |= graph_update_action(first, then, node, first_flags, then_flags, other);
 
             /* 'first' was for a complex resource (clone, group, etc),
              * create a new dependency if necessary
Index: pacemaker-1.1.16+20170320.77ea74d/pengine/native.c
===================================================================
--- pacemaker-1.1.16+20170320.77ea74d.orig/pengine/native.c
+++ pacemaker-1.1.16+20170320.77ea74d/pengine/native.c
@@ -2867,18 +2867,6 @@ native_create_probe(resource_t * rsc, no
                         top, reload_key(rsc), NULL,
                         pe_order_optional, data_set);
 
-    if(node->details->shutdown == FALSE
-       && is_not_set(rsc->flags, pe_rsc_failed)
-       && rsc->next_role != RSC_ROLE_STOPPED) {
-        /* Avoid trying to move resources before we know the location
-         * elsewhere, but stopping should always be allowed.
-         * Especially if the resource has failed.
-         */
-        custom_action_order(rsc, NULL, probe,
-                            rsc, generate_op_key(rsc->id, RSC_STOP, 0), NULL,
-                            pe_order_optional, data_set);
-    }
-
     if(is_set(rsc->flags, pe_rsc_fence_device) && is_set(data_set->flags, pe_flag_enable_unfencing)) {
         /* Normally rsc.start depends on probe complete which depends
          * on rsc.probe. But this can't be the case in this scenario as
openSUSE Build Service is sponsored by