HomeClusterLabs Projects

Low: scheduler: don't add group colocations twice

Description

Low: scheduler: don't add group colocations twice

The "*nodes == NULL" case of init_group_colocated_nodes() had the same issue
that was avoided for the non-NULL case by 53370091.

For "*nodes == NULL" (only used by cmp_resources(), which also uses
pcmkcoloc_select_this_with) init_group_colocated_nodes() would call
pcmk
add_colocated_node_scores() for the last group member. That would
recursively go through the group's internal colocations back to the first
member. For the first member, pcmk__this_with_colocations() includes the
group's own colocations. Then, when all that returned from
init_group_colocated_nodes(), it would go through the group's own colocations
again.

Simply return NULL from init_group_colocated_nodes() to avoid processing the
group's own colocations a second time. The functions can simplify a lot further
now but that will be done separately.

No regression tests change. A regression test for this isn't worth it since
it's an incredibly narrow case, a group colocated with another resource with a
non-default placement strategy where the effect of doubling the group's own
colocations causes the group to mistakenly be assigned before another resource,
and that out-of-sequence assignment yields different node assignments.

Details

Provenance
kgaillotAuthored on Apr 4 2023, 12:38 PM
Parents
rPf42c4c7a81ae: Refactor: scheduler: best practices for child_ordering_constraints()
Branches
Unknown
Tags
Unknown