Repository navigation
fix(id): capacity eviction honors the presence replay watermark (#9579) - #9584
Conversation
PresenceTable capacity eviction picked its victim by effective stamp only, defeating the #8865 replay watermark prune_at keeps: a future-stamped heartbeat evicted after effective expiry could be replayed and re-inserted with a later effective stamp, resurrecting the node past effective_ts + PRESENCE_TTL_SECS. Eviction now requires the sender stamp to also be past the TTL — exactly the prune_at rule — and refuses the admission when no entry is evictable. Adds the node_count_bound_never_evicts_a_watermark_live_entry_9579 regression test mirroring the issue timeline.
Codex Review Summary: ❌ FailedThis 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. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Fixes #9579 (triage + fix: task 16122).
PresenceTablecapacity eviction inupdate_atselected its victim by effective stamp only, defeating the replay watermarkprune_atmaintains (#8865): a future-stamped heartbeat evicted once its effective stamp aged past the TTL — while its sender stamp still passed the freshness bound — could be replayed and re-inserted with a later effective stamp, resurrecting the node up to one skew allowance (10s) past its receipt-based expiry, per capacity-eviction cycle.Change
pkgs/id/crates/id-cli/src/chat_presence.rsonly:PRESENCE_TTL_SECS— effective stamp expired and sender stamp no longer passing the freshness bound — which is exactly theprune_atwatermark rule. An entry whose sender stamp is still fresh is never evicted; if no entry is evictable, the capacity admission is refused (the existing all-fresh behavior), so the count bound still holds.Tests
node_count_bound_never_evicts_a_watermark_live_entry_9579mirrors the issue timeline: fill the table, insert a future-stamped (within skew) heartbeat, advance past effective-stamp expiry but not sender-stamp expiry, attempt a capacity admission (refused — no watermark-safe victim), replay the heartbeat, and assert the node does not read Live past its originaleffective_ts + PRESENCE_TTL_SECS. On the pre-fix filter the admission evicts the victim and the replay reads Live at that bound + skew, so the test discriminates.cargo testinpkgs/id/crates/id-cli(via fleet-build-lock on the laptop): chat_presence 27/27 pass including allnode_count_bound_*and id(chat-presence): separate future clock skew from the presence TTL #8865 replay/skew tests; full crate 671 + 7 + 7 passed, 0 failed.cargo fmt --checkclean for the file.🤖 Queue worker lane code-a, task 16122.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.