-
Notifications
You must be signed in to change notification settings - Fork 686
feat: Router warm restarts via durable KV event consumers and radix snapshotting #2756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
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
e5e2228 to
ba11255
Compare
Signed-off-by: PeaBrane <yanrpei@gmail.com>
Signed-off-by: PeaBrane <yanrpei@gmail.com>
ba11255 to
cfc1fb3
Compare
… tests) Signed-off-by: PeaBrane <yanrpei@gmail.com>
5 tasks
Signed-off-by: PeaBrane <yanrpei@gmail.com>
Signed-off-by: PeaBrane <yanrpei@gmail.com>
Signed-off-by: PeaBrane <yanrpei@gmail.com>
b893aa7 to
d6386f1
Compare
tedzhouhk
approved these changes
Aug 30, 2025
Signed-off-by: PeaBrane <yanrpei@gmail.com>
Signed-off-by: PeaBrane <yanrpei@gmail.com>
Signed-off-by: PeaBrane <yanrpei@gmail.com>
Signed-off-by: PeaBrane <yanrpei@gmail.com>
60a5fd8 to
a5528f5
Compare
Signed-off-by: PeaBrane <yanrpei@gmail.com>
KrishnanPrash
pushed a commit
that referenced
this pull request
Sep 2, 2025
…napshotting (#2756) Signed-off-by: PeaBrane <yanrpei@gmail.com> Signed-off-by: Krishnan Prashanth <kprashanth@nvidia.com>
dillon-cullinan
pushed a commit
that referenced
this pull request
Sep 5, 2025
…napshotting (#2756) Signed-off-by: PeaBrane <yanrpei@gmail.com>
nnshah1
pushed a commit
that referenced
this pull request
Sep 8, 2025
…napshotting (#2756) Signed-off-by: PeaBrane <yanrpei@gmail.com> Signed-off-by: nnshah1 <neelays@nvidia.com>
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.
Motivation
We need a way for the KV events/block states to persist when the Router goes down, so the Router (replica) can warm restart/revive. Closes #1056
Overview:
Core changes are mostly contained in
kv_router/subscriber.rs.All other changes are boilerplates and tests (unlikely serious reviewing efforts needed).
Small algorithmic notes
Kv events act idempotently on the Indexer, so it is fine for the snapshotted state to be ahead of the purged watermark. Simply put, replaying an event twice to the indexer is fine. This is what happens in our case, where we conservatively choose the purged watermark to be the min ack'ed sequence over all Router replicas.
To prevent multiple replicas from racing to purge, we put a lock key atomically into etcd while purging. The lock is tied to the etcd lease (replica lifetime), in case the process crashes while purging. Importantly, we save the radix tree state before purging the stream, to guarantee that the snapshotted state is always ahead of the stream.
Summary by CodeRabbit