Repository navigation
Description
Finding (from PR review, never addressed)
After a journal storage failure, new replication feeds can still receive a signed snapshot containing a mutation that was never durably committed. If FileJournal::append writes a complete entry but sync_data then fails, persist marks the actor storage-failed and publishes no update — but the ReplicationFeed handler reads the journal without checking that state, and replication_snapshot's newline check accepts the fully written but unconfirmed bytes. A newly connected replica therefore receives a terminal-committed snapshot containing the failed mutation while existing replicas stay at the previous durable cursor; a writer crash can also lose that mutation.
Raised on PR #4589:
- Codex (P2), 2026-11-02T21:31:55Z: feat(id): serve signed world journal replication (#806 phase 2) #4589 (comment) — "Reject replication snapshots after a storage failure" (
pkgs/id/src/world/actor.rs:1587) - CodeRabbit (Major, Data Integrity), 2026-11-02T21:37:25Z: feat(id): serve signed world journal replication (#806 phase 2) #4589 (comment) — same handler: check
storage_failedbefore callingreplication_snapshot - Related, same failure family — CodeRabbit (Minor), 2026-11-02T21:37:25Z: feat(id): serve signed world journal replication (#806 phase 2) #4589 (comment) — when
journal.appendbumps the header and then fails, subscribers are never told the header version went stale; theErrbranch should publishReplicationUpdate::ResetFailedwhenreplication_header_version()changed (pkgs/id/src/world/actor.rs:421)
No-response evidence
- PR feat(id): serve signed world journal replication (#806 phase 2) #4589 had a single commit; all three comments predate the merge (merged 2026-11-02T22:21:20Z as-is).
- All 12 review threads on PR feat(id): serve signed world journal replication (#806 phase 2) #4589 are unresolved (GraphQL
reviewThreads, checked 2026-11-03); no replies to any of these comments.
Still live on current main (verified 2026-11-03 via gh api raw reads)
pkgs/id/src/world/actor.rson main,WorldCommand::ReplicationFeedhandler (:1577-1591): subscribes and callsjournal.replication_snapshot()with nostorage_failedcheck.- Same file,
persist(:421-425): the appendErrbranch setsstorage_failed = trueand returns without publishingResetFailed(or any update) even when the header version changed. pkgs/id/src/world_store.rson main (:206-218):replication_snapshotreads the raw file and accepts any newline-terminated bytes as the snapshot.
Acceptance criteria
- The replication feed refuses (or bounds snapshots to a known-durable boundary) once storage has failed.
- The append-failure path notifies subscribers (e.g.
ResetFailed) when the journal header version changed. - A regression test simulates an append whose
sync_datafails after a complete write and shows new feeds do not receive the unconfirmed entry. - Or: a documented decision on this issue.
Found by the pr-comment-review job from unaddressed PR review comments.
Activity
dezren39 commentedon Nov 3, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 3, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 3, 2026
🤖 Agent note · picked up
Merge pull request #4738 from developing-today/queue/6705-4724-replic…
dezren39 commentedon Nov 3, 2026
🤖 Agent note · completed
ResetFailedif the journal header version changed.cf74b1ea179804fe378542592d1bcde83480afd4).replication_feed_tests— 4 passed; rustfmt 1.99.0 check andgit diff --checkpassed.