used a wrapper on dynamo local kv indexer in the engine pod for snapshotting + replay#14
Open
mohammed-deepinfra wants to merge 1 commit into
Open
Conversation
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.
[None][feat] In-process KV local indexer for ZMQ event recovery (ring-buffer + snapshot over HTTP)
Description
The KV-cache ZMQ tee (KvZmqPublisher) previously backed recovery with a fixed-window Python deque plus a ZMQ ROUTER replay socket (:5558). That design had two problems: it could only replay a bounded recent window (no full snapshot for a consumer that joins late or after eviction), and the deque path had known failure modes under large gaps (dropped-root cascade, ROUTER-HWM truncation).
This PR replaces that machinery with Dynamo's LocalKvIndexer (radix tree + replay ring buffer + tree snapshot), embedded in-process via a thin PyO3 wrapper crate. Every event the tee publishes is also fed into the indexer, keyed by event_id == seq (the same ZMQ batch sequence), so a consumer keeps detecting gaps on seq exactly as before.
Recovery moves from ZMQ to HTTP. A new endpoint GET /kv_recover?start=&end= returns an externally-tagged WorkerKvQueryResponse JSON:
The live ZMQ stream wire format is unchanged (vLLM msgpack: [topic, 8-byte BE seq, msgpack([ts,[events],dp])]), so existing live subscribers are unaffected. Only the recovery transport changed (ROUTER :5558 -> HTTP /kv_recover).
Key pieces:
Gated behind enable_local_indexer (default off), so this is a no-op unless explicitly turned on.