Repository navigation
[Router] Prove a bootstrapped replica answers like the one it copied (11/13) - #40697
Merged
Merged
Conversation
This was referenced Sep 22, 2026
Kangyan-Zhou
added this pull request to stack #40701
September 22, 2026 06:31
Kangyan-Zhou
force-pushed
the
router-peer-bootstrap-11-component-test
branch
from
September 27, 2026 02:28
3650334 to
bb5bf77
Compare
Kangyan-Zhou
force-pushed
the
router-peer-bootstrap-11-component-test
branch
from
September 27, 2026 06:15
bb5bf77 to
13e8986
Compare
Kangyan-Zhou
force-pushed
the
router-peer-bootstrap-11-component-test
branch
from
September 27, 2026 07:04
13e8986 to
9334544
Compare
Kangyan-Zhou
force-pushed
the
router-peer-bootstrap-11-component-test
branch
from
September 27, 2026 09:07
9334544 to
207c0ae
Compare
ShangmingCai
force-pushed
the
router-peer-bootstrap-11-component-test
branch
3 times, most recently
from
September 28, 2026 10:49
0442da1 to
239ea27
Compare
Kangyan-Zhou
force-pushed
the
router-peer-bootstrap-11-component-test
branch
from
September 28, 2026 21:54
239ea27 to
db42de0
Compare
Kangyan-Zhou
force-pushed
the
router-peer-bootstrap-11-component-test
branch
from
September 29, 2026 21:48
db42de0 to
d411630
Compare
ShangmingCai
force-pushed
the
router-peer-bootstrap-11-component-test
branch
from
September 30, 2026 08:34
d411630 to
7b597bf
Compare
ShangmingCai
force-pushed
the
router-peer-bootstrap-11-component-test
branch
from
September 30, 2026 10:07
7b597bf to
69964bc
Compare
Base automatically changed from
router-peer-bootstrap-10-splice-probe
to
main
September 30, 2026 10:59
…t copied Component-level proof over the real transport: an axum server serving `/internal/kv_snapshot`, a reqwest client fetching it, JSON over a loopback socket. The interesting failure modes live in the wire format and the vetting step, not in the tree algebra — that is already covered by the unit tests on `export_snapshot` / `restore_snapshot`. The equivalence assertion is deliberately behavioural: for a large query set, `match_prefix` must return the same matched length and the same carrier set on both replicas. That is the property routing actually depends on; comparing node counts alone would pass while routing diverged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YZorgAox1CpLNHSjzpcxdb
ShangmingCai
force-pushed
the
router-peer-bootstrap-11-component-test
branch
from
September 30, 2026 10:59
69964bc to
70c47a6
Compare
ShangmingCai
marked this pull request as ready for review
September 30, 2026 10:59
Collaborator
|
/tag-and-rerun-ci |
ShangmingCai
approved these changes
Sep 30, 2026
ShangmingCai
left a comment
Collaborator
There was a problem hiding this comment.
Additive only, LGTM
This was referenced Oct 2, 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.
Stack 11 of 13. Base:
router-peer-bootstrap-10-splice-probe. 2 files changed, 646 insertions(+)The stack
export_snapshot/restore_snapshot; nothing calls them yetGET /internal/kv_snapshot— the producer half; nothing consumes it yet--kv-peer-selector, the peer registry, the_peersgauges; no behaviour changeBootstrapTracker+ the fetch client; the consumer's state and transportVettedSnapshot::from_wire— the only bridge from wire bytes to the treePendingrank's batches and grafts a snapshot handed to itmatch_prefixanswers as the source ← this PR/readyzholds until bootstrap settles;--kv-bootstrap-seed-required; the metricsEach PR's base is the branch below it, so every diff shown here is that
PR's own change. Review bottom-up; GitHub retargets each child to
mainasits parent merges.
What the series does
A router replica subscribes to each worker's KV topic mid-stream, so every
block already resident in the engine's radix cache is invisible to it — and
engines publish
BlockStoredonly as they insert, so a prefix cached hoursago is never re-announced. A cache-blind replica then scatters the prefixes the
warm replicas were keeping consolidated, degrading the engines' locality for
the whole fleet; a rolling update does that to every replica in turn. This
series makes a booting replica pull a tree snapshot from a warm sibling over
HTTP and graft it beneath its live delta stream. Off unless
--kv-peer-selectoris set.
Supersedes #39750, which carried the same work as one branch on a stale base.
What this change does
Component-level proof over the real transport: an axum server serving
/internal/kv_snapshot, a reqwest client fetching it, JSON over a loopbacksocket. The interesting failure modes live in the wire format and the vetting
step, not in the tree algebra — that is already covered by the unit tests on
export_snapshot/restore_snapshot. Where a test needs a real tree, thebody served is the production producer's own export (
peer_snapshot_body),over both identity and gzip transports, so a change to how the producer builds
it cannot slip past a test-local copy.
The equivalence assertion is deliberately behavioural: for a large query set,
prefix_depths(what the local routing policies score on) andmatch_prefix(the deepest matched node's carriers and their tiers) must agree on both
replicas. That is the property routing actually depends on; comparing node
counts alone would pass while routing diverged.
Fresh-engine fix
Rebased onto the fixed #40693–#40696. The one change: the component test's
PeerSnapshotliteral gains the newempty_ranksfield.Tests
cargo fmt --check,cargo clippy --all-targets -- -D warnings, and the lib +component + proxy suites all pass on this branch on its own, not only on the
tip of the stack.
Review pass
Reviewed with
/code-review --fixand/simplify; fixes were folded into this PR's own commit and the stack was re-verified tier by tier (cargo fmt --check,cargo clippy --all-targets -D warnings, lib + component + proxy tests on every branch).tests/component/policies/kv_events_peer_bootstrap.rs; it touches none of the splitsrc/files.🤖 Generated with Claude Code
https://claude.ai/code/session_016HmJvHV7QDPk3qAjQYzthd
CI States
Latest PR Test (Base): ✅ Run #36705762191
Latest PR Test (Extra): ❌ Run #36705761997
Latest PR Test (AMD ROCm 10): ➖ No AMD PR run found for this commit.