Repository navigation
refactor(kv-router): KvIndexSource names where a partition's KV index comes from - #39
Closed
ishandhanani wants to merge 1 commit into
Closed
ishandhanani wants to merge 1 commit into
ishandhanani wants to merge 1 commit into
Conversation
…ex comes from
Replace three knobs that together described the same thing (the builder's
external_kv_events() and remote_indexer(), and SelectionHost's
OverlapRefreshSource) with one KvIndexSource on HostCache:
- Owned: the core owns the index and subscribes to worker KV events over ZMQ
(the standalone default; workers need KV-event endpoints).
- External { refresh }: the host owns and feeds the index; workers need no
KV-event metadata; refresh optionally lets the core re-score queued
requests against the host's index (the frontend's embedded partition).
- Remote(url): a standalone indexer serves the primary index.
The listener decision, schedulability metadata, and dequeue-time refresh all
derive from this one value. SelectionServiceBuilder::kv_index sets it;
SelectionServiceConfig and the Python bindings map remote_indexer_url onto
Remote. No behavior change.
Signed-off-by: Ishan Dhanani <[email protected]>
ishandhanani
had a problem deploying
to
external_collaborator
September 3, 2026 22:13 — with
GitHub Actions
Failure
This was referenced Sep 3, 2026
Closed
Owner
Author
This branch had an error being deployed
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.
Stack 1, group C (KV index and ingress), first slice. Stacked on #38. DEP #33, "Stack 1 DEP r2" comment.
Summary
One logical change:
SelectionHost.cache.index: KvIndexSourcereplaces three knobs that jointly described where a partition's KV index comes from:SelectionServiceBuilder::external_kv_events()+OverlapRefreshSource::External(p)KvIndexSource::External { refresh: Some(p) }external_kv_events()+OverlapRefreshSource::DisabledKvIndexSource::External { refresh: None }SelectionServiceBuilder::remote_indexer(url)KvIndexSource::Remote(url)PartitionIndexer)KvIndexSource::Owned(ZMQ direct ingress)The core derives the KV-event listener decision, the worker schedulability metadata, and the dequeue-time overlap refresh source from this one value.
SelectionServiceBuilder::kv_indexsets it;SelectionServiceConfigand the PythonSelectionServicebindings mapremote_indexer_urlontoRemote. The frontend's embedded partition now declaresExternal { refresh: <its indexer> }. No behavior change.What remains in group C (not in this PR)
The DEP's second half of group C is moving the frontend's KV index and per-rank recovery state machine into the core so
KvIndexSource::Ownedcarries aKvEventIngress(RuntimeIngressinlib/llm,ZmqDirectIngressinlib/kv-router) and the frontend stops keeping its own index. Inventory from this pass, for the follow-up PR:Indexerenums (lib/llm/src/kv_router/indexer/mod.rsandlib/kv-router/src/services/indexer/backend.rs) have identicalSingle|KvIndexer/Concurrent/Remoteshapes. The frontend adds:None, a request-planeRemoteIndexer(core's is HTTP),reset_worker_dp_rank_and_wait(completion barrier the recovery state machine needs),try_apply_event(backpressure-aware admit), residency projection/routing snapshot, approximate-LRU capacity and stats,store_eventrecording, andfind_matches_by_tier[_ref].RecoveryTarget(indexer/recovery/target.rs) already isolates what recovery needs from the index:admit_event,replace_rank,reset_rank. Implementing it for the core'sIndexeris the seam forRuntimeIngress.worker_query.rs,state_agent.rs,subscriber.rs,direct_zmq.rs,broker_zmq.rs,source_health.rs; ~11k lines) is transport-bound (event plane, request plane worker query) and stays inlib/llmas theRuntimeIngressimplementation; only the index moves.I stopped this PR at the boundary type so the frontend and EPP keep their exact current index behavior while the API already names the three sources.
Validation
cargo test -p dynamo-kv-router --features standalone-selection --lib -- services::selection: 81 passed (includes the remote-indexer test:use_kv_events=truewith a remote primary starts no listener).cargo test -p dynamo-llm --lib -- kv_router::: 325 passed.cargo clippyfordynamo-kv-router,dynamo-llm,dynamo-ext-proc(tests): clean. Bindingscargo check: clean.Review notes (graham-code-review pass)
IndexerPolicystays the internal, resolved form;KvIndexSource::Remoteis the public input that produces it inbuild(). The core still receives the resolved policy soSelectionCore::new_innerstays infallible.KvIndexSource::Ownedis a unit variant on purpose: there is one ingress today. It grows a payload whenRuntimeIngresslands rather than carrying a one-variant enum or a trait object with a single implementation now.