File pacemaker-pengine-dont-keep-unique-instances-on-same-node.patch of Package pacemaker.14737
commit 6c4aa5023b8c985cca9d7137e5f7de41015cf282
Author: Ken Gaillot <kgaillot@redhat.com>
Date: Tue Oct 24 15:37:00 2017 -0500
Fix: pengine: don't keep unique instances on same node
Fixes CLBZ#5326
Index: pacemaker/pengine/native.c
===================================================================
--- pacemaker.orig/pengine/native.c
+++ pacemaker/pengine/native.c
@@ -148,9 +148,18 @@ native_choose_node(resource_t * rsc, nod
pe_rsc_trace(rsc, "Chose node %s for %s from %d candidates",
chosen ? chosen->details->uname : "<none>", rsc->id, length);
- if (chosen && chosen->weight > 0 && can_run_resources(chosen)) {
+ if (!((rsc->parent
+ && ((rsc->parent->variant == pe_clone) || (rsc->parent->variant == pe_master)))
+ && is_set(rsc->parent->flags, pe_rsc_unique))
+ && chosen && (chosen->weight > 0) && can_run_resources(chosen)) {
/* If the resource is already running on a node, prefer that node if
* it is just as good as the chosen node.
+ *
+ * We don't do this for unique clone instances, because
+ * distribute_children() has already assigned instances to their
+ * running nodes when appropriate, and if we get here, we don't want
+ * remaining unallocated instances to prefer a node that's already
+ * running another instance.
*/
node_t *running = g_list_nth_data(rsc->running_on, 0);