Repository navigation
fix(atlas): Preserve preferred affinity fallback during resize - #316
Merged
tanmoysrt merged 6 commits intoOct 4, 2026
Merged
Conversation
A moving resize always has a current host, so affinity filtering returned before reading the Preferred matching setting. When neither the current host nor a matching destination had room, this removed a fitting nonmatching fallback and caused OutOfCapacity. Evaluate the affinity matching mode when the retained current/matching hosts have no capacity, while preserving Enforced behavior.
Reuse the affinity test helper, and drop the comment that the docstring now covers.
Member
|
Try to keep comments, docstrings smaller and easy to understand. Trimmed it for now. |
tanmoysrt
enabled auto-merge
October 4, 2026 13:58
Contributor
Author
|
Thanks, noted. I’ll keep comments and docstrings concise and limited to non obvious behavior going forward 😃 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
A moving resize with placement rules can skip the
Preferredaffinity fallback.When the current Metal Server cannot fit the resize delta and no affinity-matching destination can fit the target shape, a nonmatching server with enough capacity should remain available under
Preferred.The affinity filter currently returns as soon as a resize has a current host, before reading the
Affinity Matchingsetting. This removes the nonmatching fallback and the resize ends inOutOfCapacity.For example:
Affinity MatchingisPreferred.Before this change, placement keeps A and C, drops B, and returns
OutOfCapacity.Summary
Evaluate the affinity matching mode when none of the retained current/matching hosts has room.
Preferredcan then fall back to the full host set, whileEnforcedcontinues to keep the current/matching set and never uses a nonmatching destination.Why
A resize always has a current host. The previous early return treated the existence of that host as sufficient reason to keep the affinity-filtered snapshot, even when the current host could not accommodate the resize.
That made the
Preferredbranch unreachable for this moving-resize case.This keeps the current host in the candidate set for in-place resize, but only commits to the affinity-filtered set when one of those candidates actually has room.
What changed
Preferredmoving resize fall back when neither the current host nor an affinity-matching host has capacity.Enforced.This preserves the
Preferredfallback semantics introduced with the affinity placement behavior in #310 for moving resizes.Validation
Retained hosts: ['a', 'c']; affinity setting reads: 0) and passes with this change.Enforcednever falls back to the nonmatching host.PreferredVM creation without a current host still falls back as before.PlacementBusyinstead of relaxing affinity.metaldsync and real capacity reports: pristine placement returnedOutOfCapacity; patched placement selected the nonmatching fallback. No production site or customer workload was modified.