Repository navigation
Conversation
ReplicationTracker::accept rebased onto any snapshot chain, including one with a lower header version than the verified chain — silently rolling the replica back and re-admitting old-version tails. Refuse downgrades with HeaderVersionChanged; equal-version rebase and header bumps stay accepted. Fixes #4487
|
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 43 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. |
Codex Review Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ddbab0a1c
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| #[test] | ||
| fn snapshot_with_a_lower_header_version_is_refused() { |
There was a problem hiding this comment.
Add property coverage for snapshot version monotonicity
The new replication invariant is covered only by fixed downgrade and equal-version examples. Root AGENTS.md explicitly requires property tests for replication/state-machine invariants and says examples do not replace them. Add a proptest over supported snapshot-version sequences that checks accepted versions never decrease and rejected snapshots preserve the complete tracker state, including last_frame_digest; the current assertions check only the version and cursor.
AGENTS.md reference: AGENTS.md:L41-L45
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in d6449f8: added snapshot_versions_never_decrease_and_refusals_preserve_state, a proptest (64 cases) over generated snapshot-version sequences (1..=MAX_JOURNAL_VERSION). It asserts accepted versions never decrease, and that every refused downgrade returns HeaderVersionChanged while preserving the complete tracker state — header_version, cursor, and last_frame_digest (read directly from the tracker in-module). Verified passing on the laptop along with the replication suite (44 tests).
Codex review finding on PR #7357: the downgrade invariant was covered only by fixed examples. Add a proptest over snapshot-version sequences asserting accepted versions never decrease and refused snapshots preserve the complete tracker state (version, cursor, last frame digest).
|
Closing as superseded — shepherd pass, queue task 17324 (90-day review open-PR pass). Fresh evidence, all checked 2026-11-16:
Outcome recorded per the shepherd acceptance: closed with fresh evidence the change is landed elsewhere. Head branch left in place (packet scope excludes deleting it while closing is in flight; it is inert). |
Fixes #4487
ReplicationTracker::acceptrebased onto any Snapshot frame's chain — including a snapshot with a lower header version than the chain already verified. Tail and Terminal frames refuse any version change (HeaderVersionChanged), but the Snapshot branch assignedself.header_version = envelope.header_versionunconditionally, so a stale snapshot silently rolled the replica back to an older journal version and re-admitted old-version tails.Change
pkgs/id/src/world/replication.rs— Snapshot branch: refuseenvelope.header_version < self.header_versionwithReplicationError::HeaderVersionChanged, before any state changes. Equal-version rebase (first sync / compaction) and header bumps stay accepted, per the existing design comment andsnapshot_rebases_the_chain_on_a_header_bump.Tests (oracle: tracker state invariants — a refused frame leaves the last complete replica state intact)
snapshot_with_a_lower_header_version_is_refused— after a bump to version 2, a version-1 snapshot is refused andheader_version/cursor are unchanged.snapshot_at_the_current_header_version_still_rebases— same-version snapshot after a tail is still accepted.Queue task 12693 (lane code-w).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.