Skip to content

fix(id): capacity eviction honors the presence replay watermark (#9579) - #9584

Merged
dezren39 merged 1 commit into
mainfrom
queue/16122-9579-presence-eviction-watermark
Nov 13, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/16122-9579-presence-eviction-watermark

Conversation

@dezren39

@dezren39 dezren39 commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #9579 (triage + fix: task 16122). PresenceTable capacity eviction in update_at selected its victim by effective stamp only, defeating the replay watermark prune_at maintains (#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.rs only:

Tests

  • New regression test node_count_bound_never_evicts_a_watermark_live_entry_9579 mirrors 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 original effective_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 test in pkgs/id/crates/id-cli (via fleet-build-lock on the laptop): chat_presence 27/27 pass including all node_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 --check clean for the file.

🤖 Queue worker lane code-a, task 16122.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

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.
@dezren39
dezren39 requested a review from a team as a code owner November 13, 2026 16:35
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-13T16:35:20.099517Z
We couldn’t complete this review. Comment @codex review to try again.
2c0b332 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3b20bea1-1e1e-42be-9016-932988afdb7b
Commits

Reviewing files that changed from the base of the PR and between 70acfa4 and 2c0b332.

Files selected for processing: 1

  • pkgs/id/crates/id-cli/src/chat_presence.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant