HomeClusterLabs Projects

Fix: libpacemaker: Respect clone-node-max for cloned groups

Description

Fix: libpacemaker: Respect clone-node-max for cloned groups

Currently, cloned groups may have more than clone-node-max instances
assigned to a given node. This can happen when a location constraint
exists for the clone.

For example, consider the case of the clone-recover-no-shuffle-5 test.
The cloned group prefers node1 with a score of 100. The location score
is applied only to a group's first member.

So in the early assignment attempt (within pcmk__assign_instances()), we
try to assign each instance (group) to its current node. However, the
first member prefers a different node (node1) and gets assigned there
instead. The second member has to follow the first due to the group's
internal colocation.

However, node1 wasn't the preferred node. So assign_instance() tries to
revert the assignment by calling pcmkunassign_resource() on the
instance (the group). But this leaves the group members assigned,
because pcmk
unassign_resource() doesn't act recursively.

With this commit, pcmk__unassign_resource() acts recursively. We can now
unassign a resource and all its children recursively.

Fixes T678

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Jun 28 2023, 5:08 AM
Parents
rPa28e637fbde3: Refactor: libpacemaker: Restore node tables if cloned group assign fails
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task
Restricted Maniphest Task