Skip to content

fix: account for current guest nodes and allow anti-affinity migrations from non-peak nodes - #138

Open
dguerri wants to merge 1 commit into
credativ:mainfrom
dguerri:fix/anti-affinity-placement-and-relocation
Open

dguerri wants to merge 1 commit into
credativ:mainfrom
dguerri:fix/anti-affinity-placement-and-relocation

Conversation

@dguerri

@dguerri dguerri commented Oct 6, 2026

Copy link
Copy Markdown

Description

  1. Calculations.val_anti_affinity used used_nodes which starts empty and only recorded nodes chosen during the current relocation run. It did not check the existing locations of other members in the anti-affinity group, allowing guests to be assigned to nodes already hosting another member of the group.
  2. Calculations.relocate_guests unconditionally broke out of the guest relocation loop if the guest's source node was not the highest-loaded node in the cluster (highest_node.name != source_node). If anti-affinity group members were co-located on a non-peak node, ProxLB would never move them to resolve the violation.

Solution

  • Pre-populate occupied_nodes in val_anti_affinity with the current or target nodes of all other members of the anti-affinity group before choosing an assignment.
  • Exempt anti-affinity-violating guests from the highest_node != source_node early-exit when enforce_affinity is active.

Added unit tests in tests/test_calculations_anti_affinity_relocation.py validating anti-affinity target selection and non-peak node relocation.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant