GeezerVison is showing github.com — id(world): selectable journal ack modes — sync default, batched, async (#557) by dezren39 · Pull Request #12746 · developing-today/code
Conversation
dezren39
commented
Nov 23, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Implements Drewry's 2026-11-22 decision on #557 (comment 7087900634): async/batched input acknowledgement as selectable modes — not a default flip. The documented durability contract stays the default.
Design
Design record (pkgs/id documentation protocol, written before the code): doc/2026-11-23T00-24-00Z_design_journal_ack_modes/.
JournalAckMode (world/journal.rs, re-exported from crate::world): Sync (default — acknowledged ⇒ durable, byte-for-byte the old behaviour), Batched (write on ack, one sync per JOURNAL_ACK_BATCH_SIZE = 64 appends; loss bounded to the unsynced tail), Async (no sync on the ack path; durability only at sync points). The tradeoff text for all three durability levers sits on the enum where the modes are defined: ack timing (this change), the fdatasync primitive (unchanged), and group commit — syncfs sharing measured-and-rejected on three filesystems (runner ~2.5×, btrfs ~1.26×, laptop ext4 1.07× median / 1.44× p99 vs fdatasync) and fdatasync group commit measured at zero queueing headroom. The fsync/syncfs axis is discussed in the same pass, per the decision.
WorldJournal gains ack_mode() and sync() with Sync/no-op defaults — every existing journal (including all test doubles) keeps the old contract without code changes.
FileJournal: appends route through append_write per mode; unsynced_appends() exposes exactly the acknowledged history an OS crash could still lose (always 0 in Sync). Transactions and compaction remain full sync points in every mode. The journal format and recovery scan are untouched, so reopening under a different mode replays identically — a mode changes what future acks promise, never what existing bytes mean.
- Config surface:
WorldLimits::journal_ack_mode (default Sync), plumbed through open_world to FileJournal::open_with_ack_mode. Existing open/open_with_max_bytes delegate with Sync.
Tests (laptop venue, under fleet-build-lock)
Fail-before: the six new tests applied alone to pristine origin/main fail to compile — 26 errors (no JournalAckMode, open_with_ack_mode, unsynced_appends, JOURNAL_ACK_BATCH_SIZE, trait ack_mode/sync).
Pass-after (this branch):
cargo test -p id-worlds --lib journal_ — 66 passed, 0 failed, including the five new mode tests: default mode writes the exact pre-change byte image and never leaves unsynced_appends at zero unobserved; async acks before any sync and an explicit sync() flushes; batched syncs exactly at the 64-append bound counted across append/append_batch; a journal written async replays identically under sync/batched (and vice versa); compaction is a sync point in async mode.
cargo test -p id-worlds --lib world_store:: — 51 passed, 0 failed (the whole store module, incl. the open_world path).
cargo test -p id-worlds --lib world_limits_default — 1 passed (WorldLimits default is Sync).
cargo fmt -p id-worlds -- --check clean (one assert reflowed).
- Clippy: not run to completion — the laptop's shared broker target dir fails clippy with E0514 (clippy-driver vs cached rlib toolchain mismatch), the identical failure the id: F12.5 first new providers — kv, blob, http.fetch, notify #1062 lane recorded; no new warnings reference the touched code in the test build.
Not in this PR

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
#557)
Implements Drewry's 2026-11-22 decision: async/batched input
acknowledgement as selectable modes, not a default flip.
- JournalAckMode (world/journal.rs): Sync (default, the original
durability-before-ack contract, byte-for-byte), Batched (one sync
per JOURNAL_ACK_BATCH_SIZE=64 appends; loss bounded to the unsynced
tail), Async (no sync on the ack path; durability only at sync
points). The tradeoff text for all three levers — ack timing, the
fdatasync primitive, and the measured-and-rejected syncfs/fdatasync
group commit — lives on the enum where the modes are defined.
- WorldJournal gains ack_mode() and sync() with Sync/no-op defaults,
so every existing journal keeps the old contract.
- FileJournal implements the modes: appends write through
append_write, unsynced_appends() exposes exactly the acknowledged
history an OS crash could still lose, and compaction/transactions
remain full sync points in every mode. The journal format and
recovery scan are unchanged, so a mode switch on reopen replays
identically.
- Config surface: WorldLimits::journal_ack_mode (default Sync),
plumbed through open_world to FileJournal::open_with_ack_mode.
- Design record per the pkgs/id documentation protocol:
doc/2026-11-23T00-24-00Z_design_journal_ack_modes.
- Tests: default-mode byte-for-byte disk image, async ack-before-sync
+ sync-point flush, batched sync exactly at the batch bound across
append/append_batch, cross-mode reopen replay identity, compaction
as a sync point, WorldLimits default.
No new dependencies. No performance claim: the unloaded laptop
re-run remains the outstanding #557 baseline.
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:
2e9558bc-ea4d-433c-95fe-5a54a8bbb640
Commits
-
Reviewing files that changed from the base of the PR and between e6268f8 and d3473df.
Files selected for processing: 5
-
doc/2026-11-23T00-24-00Z_design_journal_ack_modes/2026-11-23T00-24-00Z_design_journal_ack_modes.md
pkgs/id/benches/BASELINES.md
pkgs/id/crates/id-worlds/src/world/journal.rs
pkgs/id/crates/id-worlds/src/world/mod.rs
pkgs/id/crates/id-worlds/src/world_store.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
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|