HomeClusterLabs Projects

Fix: scheduler: properly consider effect of "with group" colocations

Description

Fix: scheduler: properly consider effect of "with group" colocations

Previously, the add_colocated_node_scores() method had two implementations, one
for groups and one for everything else. However it was unusual in that the
non-group implementation had code to handle groups, and was called directly
(instead of via the method pointer) in multiple places.

All differences between the two favor the non-group implementation, even for
groups, so just call the non-group implementation directly in all uses, and
drop the method (and the group-specific implementation) entirely:

  • cmp_resources() calls the non-group implementation directly, and group-specific code for that case is only in that implementation. The group implementation lacked that code but simply wasn't called in that situation.
  • The non-group implementation ignores ("rolls back") the effect of colocations that would prevent the primary from running altogether.
  • The non-group implementation uses a negative factor for anti-colocations.
  • The non-group implementation observes the colocation "influence" property.
  • The group implementation iterated through the group's "with this" colocations, whereas the non-group implementation iterated through the last group member's. However, pcmk__group_assign() -> expand_group_colocations() adds the group's colocations to the last member's then NULLs the group's, so the group implementation was doing nothing.

Details

Provenance
kgaillotAuthored on Oct 24 2022, 6:00 PM
Parents
rPf899c8c3f5cf: Low: scheduler: ensure group methods handle empty groups
Branches
Unknown
Tags
Unknown