[Bugfix] scheduler: defer gang pin until hard spread filtering - #867
Draft
robin-inferact wants to merge 1 commit into
Draft
[Bugfix] scheduler: defer gang pin until hard spread filtering#867robin-inferact wants to merge 1 commit into
robin-inferact wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
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.
What this PR does
DoNotSchedule) topology-spread constraint, havePreFilterexpose the union of all domains that can hold the complete gang instead of pinning one domain before the regular scheduler filters run.Reserve, then use the existing reservation handoff and Permit gate.PreScoreacross only the domains that survived normal filtering.Soft
ScheduleAnywayconstraints retain the current packing behavior. The change deliberately does not parse or reimplement PodTopologySpread semantics; the built-in plugin remains authoritative.Why we need it
GangPack currently picks and reserves one co-location domain in
PreFilter. A later framework filter can veto every node in that domain even when a different whole-gang-feasible domain would pass. The existingPostFilterrecords the first domain as failed, but the same pending gang may receive no prompt second scheduling cycle.This is visible with OME's own required replica spreading. In a two-rack Kind test, replica 0 occupied rack8, replica 1 initially best-fit-pinned rack8, and PodTopologySpread correctly rejected it. Rack9 remained feasible, but the gang waited for
InstanceReadyTimeoutand Pod recreation before retrying there.Deferring only the irreversible domain commitment lets the scheduler compose normally:
This also works when the spread key differs from the gang key, including a coarser failure domain or node-level
kubernetes.io/hostnamespreading.How to test
The external OME + real-SMG Kind harness also passed with the scheduler requeue workaround disabled:
Observed result:
leadersRequiringExplicitRequeue: 0, zero backend-unavailable responses, successful compatible and incompatible zero-surge rollouts, successful whole-gang worker restart, and successful same-domain gang admission.Checklist
make testpasses locally (focused root tests plus the complete scheduler module and external Kind suite were run)