Repository navigation
fix(net): skip a stale warm cache on an IETF rejoin - #4150
Conversation
An IETF live join delivers nothing below the group its SUBSCRIBE_OK names as Largest, so declare that as the copy's start. A parked track's warm cache waiting on the copy then sees the upstream moved past it and live readers skip it, as they already do on lite-06+. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 20 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
MERGE Positive improvement. #4104 already taught live readers to wait on the warm cache until the upstream copy declares a start floor, then skip it when that floor is past the cache. IETF never declared one, so the cache always released and Worth the complexity. Eleven lines in No better approach jumps out. Inferring the floor from the first served group (the path still open for pre-06 lite) would make a returning reader wait on an empty upstream; Largest is the signal the draft already gives for a live join. Expanding the stale-cache test across lite-06+ and every IETF draft, with the version in assertion messages, is the right regression net. Leaving pre-06 alone with an explicit skip note is fine unless someone later wants that tradeoff. This is an automated review, not the maintainer's decision |
Problem
#4104 stopped a relay from handing a returning reader a parked track's stale warm cache, but only for lite-06+ upstreams. On an IETF upstream (every draft), a rejoining reader still got the newest cached group before live, the same as on
main:broadcast_rejoin_skips_a_stale_warm_cachefailed on IETF with "served the stale cache first: group 3".After #4104, live readers wait on the warm cache until the next upstream copy declares where its feed starts, and skip the cache if that start is past the cache's newest group. The IETF subscriber never declared a start, so the cache was always released.
Approach
An IETF re-subscription is always a live join. The request is only accepted at SUBSCRIBE_OK, so the SUBSCRIBE goes out before any reader is attached and carries no start. A live join delivers nothing below the group SUBSCRIBE_OK names as Largest: the draft-20 fill and the pre-20 joining FETCH both begin at that group. So the IETF subscriber now declares that group as the copy's start, atomically with accepting it. A warm cache whose newest group is older is skipped. One the upstream is still on (a quiet catalog, or an open JSON log) is kept. With no Largest (no content), no start is declared and the cache is kept.
Tests:
broadcast_rejoin_skips_a_stale_warm_cachenow sweeps lite-06+ and every IETF draft. It fails on IETF without the fix.broadcast_rejoin_replays_a_current_warm_cache(from fix(net): hold a parked track's warm cache until the upstream confirms it #4104) still passes on every version, so a quiet track never waits on an update that may never come.Impact
poll_peek_group, which treats a missing group below the floor as skipped rather than pending. That is true for a live join.Not covered
Pre-06 lite upstreams still serve one stale group on rejoin (same as
main). Their SUBSCRIBE_OK carries no Largest, so the only signal would be the first served group. That would make a returning reader wait on an empty upstream track. Say if it's worth doing.🤖 Generated with Claude Code
(Written by Claude Opus 5.5)