Repository navigation
fix(stargate): expire reservations after backend RTT - #2295
efegokdemir wants to merge 5 commits into
Conversation
Signed-off-by: Efe Gökdemir <gokdemirefe1903@gmail.com>
|
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: true
Comment |
FamousDirector
left a comment
There was a problem hiding this comment.
Reviewed the reservation lifecycle (reserve, expiry, release, backend removal, cluster generation replacement), the RTT source (per-backend health-check RTT from latest_ready_rtt_or_probe), config validation, metrics, and docs. Expiry logic and pruning look correct; the CAS in deactivate keeps release and expiry from double-decrementing. Two inline findings below.
Minor, outside the inline comments:
reservations.rs:117still says a successful attempt "remains pending until its heartbeat". It now remains pending until its TTL.runtime-stats-interface.mdsays "before enabling this Stargate behavior", but there is no enable switch; the behavior is unconditional once this Stargate ships. Consider "before deploying this Stargate version".
Local results at 4cb4ac8: cargo test -p stargate --lib 396 passed, --test stargate_integration 149 passed, --bins 52 passed with 1 failure in the unchanged occupied_metrics_port_fails_before_runtime_construction (matches what the PR description reports).
Signed-off-by: Efe Gökdemir <gokdemirefe1903@gmail.com>
The existing retired-generation test ends the registration through StargateState, which deactivates reservations on the routing removal path, so it still passes with the Drop impl removed. These tests retire the generation through the registration table only, so the replacement upsert or Inactive removal drops the old cluster state with a live reservation. Both fail without Drop. They also check that an earlier release followed by the drop does not double-decrement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drive proxied requests through a minimal raw QUIC mock tunnel so the tests observe the expected queue header exactly as Stargate sends it. Cover that the reservation TTL follows the dispatched backend RTT rather than the cluster mean, that unexpired reservations raise the expected queue estimate while expired ones do not, and that only a queue-mismatch 429 releases a reservation early. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Add a 600 s UNEXPIRING_TEST_RESERVATION_TTL and use it in the cfg(test) reserve_backend helper and the reservation tests that previously used a 1 s TTL, so they no longer depend on finishing within 1 s of wall time. - Reserve with the long TTL in the expiry boundary test. The registration update (which prunes with the real clock) can no longer flake on a slow runner; boundary checks stay relative to expires_at via routing_snapshot_at, and the test also checks the active gauge. - Rename consumed_by_heartbeat to released_after_update, since updates no longer consume reservations. - Assert stargate_routing_reservations_active goes from 10000 to 0 in the idle expired prune test. - Describe lazy expiry and backend removal for the stargate_routing_reservations_active gauge in the metrics doc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I have left this in draft because the contribution guide requires a DCO sign-off on every commit. The three commits added on 9 October ( |
TL;DR
Keep each optimistic routing reservation until one clamped RTT of its selected backend has elapsed instead of clearing it on the next registration update. Adds configurable TTL bounds, reservation metrics, and coverage for expiry, updates, release, and backend removal.
Additional Details
An update can briefly double-count a request if Pylon reports it before its reservation expires. Roll out change-driven Pylon stats before deploying this Stargate version.
Three-arm simulator validation
Completed against the discrete-event simulator at
NVIDIA/nvcf#2223head9e9a86e. Each arm ran three seeds at 80, 160, 240, and 320 offered RPS, with a 60-second warmup and 180-second measurement per scenario. The model uses the five-region topology, one modeled H100-batched worker per backend, and fixed 6,661-token inputs.Values are mean goodput RPS across the three seeds. Mean TTFT p99 (baseline / coalesced-clear / coalesced-TTL) was 13.45 / 14.14 / 13.98 s at 80 RPS, 14.14 / 14.50 / 14.77 s at 160, 14.17 / 14.71 / 14.72 s at 240, and 14.60 / 14.57 / 14.63 s at 320. Timeout counts were 24/1/0, 29/0/0, 33/0/1, and 75/0/0, respectively.
In this model, TTL versus the coalesced-clear arm has mixed, small goodput/latency differences and no clear throughput improvement. The lower goodput versus baseline appears in both coalesced arms, so it is not attributed to TTL alone. These are simulator results, not GPU benchmark measurements; the TTL change is intended to preserve in-flight reservations across stats updates.
The PR remains a draft while maintainers assess this correctness/throughput trade-off.
For the Reviewer
Please focus on reservation expiry and pruning in the routing snapshot lifecycle.
For QA
cargo test -p stargate --lib(399 passed)cargo test -p stargate --bin stargate -- --skip occupied_metrics_port_fails_before_runtime_construction(52 passed)cargo test -p stargate --test stargate_integration(149 passed)cargo clippy -p stargate --lib --tests -- -D warningscargo clippy --locked -p stargate --all-targets -- -D warningscargo fmt --all -- --checkgit diff --checkcargo test -p stargatehas one failure in the unchangedoccupied_metrics_port_fails_before_runtime_constructiontest; it also fails when run alone in this environment.Issues
Relates to #2284
Checklist