You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(disaggregation): gating at head; skip when header pins or ≤1 revision
Moves the gating filter to the head of the scheduler filter chain
(prepended after strict, so it ends up in front of it), making the
revision-axis decision the very first step per request. Chain order
becomes:
gating → strict → operator → prefer
Only one of gating/strict actually makes the revision decision on any
given request; the other detects the situation and short-circuits.
Gating skips (passthrough, no cache List, no RNG) when:
1. The revision-axis strict header is set — strict downstream will
pin the revision. Gating firing here would either waste work or
stochastic-pick a revision that strict then rejects (503).
2. The candidate pool contains ≤1 unique revision — nothing to
shape, either because the fleet has one revision or an upstream
filter already narrowed.
Otherwise gating does its weighted-random-pick as before (weight per
revision = Σ Ready pod count over gating.requireRoles.values), drops
uncovered revisions, and keeps only the chosen revision's pods.
Everything downstream of the head now sees a single-revision candidate
pool. Operator-declared filters and prefer no longer walk multi-
revision pools when the decision has already been made.
Also renames scanCoverage → readyPodsByRevisionRole. The old name
implied "checks coverage" but the function also returns raw per-role
counts used by the gating weights; the new name describes the data
structure directly.
Tests:
- wire_test.go: order assertion flipped to gating < strict < operator
< prefer.
- New: TestGatingFilter_SkipsWhenRevisionHeaderPresent — panicking
rand01 asserts the fast path fires when the header is set.
- New: TestGatingFilter_SkipsWhenSingleRevisionInPool — same, for
the ≤1-revision fast path.
Live-verified on kind against the three shapes covered by
scripts/verify-slow-transition.sh (10p10d, 2p20d, 20p2d) — all steps
land within ±10pp of the expected cross-role weighted share; zero
cross-revision mismatches, zero request failures during transitions.
Signed-off-by: Mathis Felardos <mathis@mistral.ai>
0 commit comments