Repository navigation
feat(global-router): route round robin over pools from discovery - #17273
Merged
sachalmalick merged 1 commit intoOct 25, 2026
Merged
sachalmalick merged 1 commit into
sachalmalick merged 1 commit into
Conversation
Add RoundRobinSelector. It rotates through the pools serving a model, then through the chosen pool's frontends, so every pool gets an equal share however many frontends it has. It reuses the runtime's BuiltinRoutePicker unchanged, with one cursor per model and per pool. It replaces FirstPoolSelector. Add DiscoveryPoolCatalog, which polls the Global Discovery Service's GET /pools. It keeps the last pools through a discovery outage and publishes only when the pools change. Add GlobalDiscoveryClient::pools for it. global-ingress takes --discovery-url as the alternative to --pool and routes round robin. Move the shared test helpers into tests/common. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Sachal Malick <s@chal.ai>
sachalmalick
marked this pull request as ready for review
October 25, 2026 08:43
sachalmalick
merged commit Oct 25, 2026
74c2ec4
into
sachalmalick/global-ingress-forwarding
28 of 34 checks passed
This was referenced Oct 25, 2026
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.
Summary
Round-robin routing for the Global Frontend, over pools read from the Global Discovery Service. Stacked on #17272.
RoundRobinSelector(lib/global-router/src/selector.rs)dynamo_runtime::pipeline::BuiltinRoutePickerunchanged, the same waydynamo-llm'skv_router/routing_host/builtin.rsdoes. There is one cursor per model and one per pool. Candidate positions stand in for worker IDs, since round robin only counts.least_loaded()andpower_of_two_choices(), passing a load function.FirstPoolSelector.DiscoveryPoolCatalog(lib/global-router/src/discovery.rs)GET /poolsonce at startup, then on an interval.GlobalDiscoveryClient::pools()(lib/global-discovery-client)Snapshot<PoolListing>and maps the service'scompleteflag toCompleteness.routers(), one bad entry fails the whole call. Both now share one body-decoding helper.global-ingress--discovery-url(with--discovery-interval-secs) as the alternative to--pool. A clap argument group requires exactly one of the two.tests/common/mod.rs.Not in this PR: a pool counts as routable whenever the discovery service lists it. Gating on live Pool Relay state streams (GlobalViewReceiver) waits for a Relay-to-router stream transport, which doesn't exist yet.
PoolSelectordoesn't change when it lands.Validation
cargo test -p dynamo-global-ingress -p dynamo-global-router -p dynamo-global-discovery-client: 29 passed. The new ones:GET /pools, including a Kubernetes-style entry with no model; an estimated (partial) list; one bad frontend URL failing the whole call.dynamo-global-discovery-service(memory store, in-process). Two registered pools each get 2 of 4 requests. A third pool registered later joins the rotation without a restart, giving 3/3/1 after 3 more requests.cargo clippy --all-targetson the three crates: no warnings in them.cargo fmtapplied.global-discovery-service, registered a pool withcurl, and startedglobal-ingress --discovery-url;/v1/modelslisted the pool's model, and chat reached the pool (503, because its frontend was a closed port);--discovery-urlnor--pool, or both, is rejected with the argument group's error.🤖 Generated with Claude Code