Skip to content

moonpool-journal: remove checkpoint batches; the journal is append, read and truncate #306

Closed

Description

@PierreZ

Why

#302 (landed in PR #305) added checkpoint batches to moonpool-journal: Journal::append_checkpoint, Journal::checkpoint(), Recovery::checkpoint, and a per-slot / per-entry checkpoint entry count in the on-disk format (format v4, FLAG_CHECKPOINT + the count field at offset 56).

That was a layering mistake. It pushed one caller's compaction rule (paros's copy-forward Begin…End brackets) into the journal. A checkpoint is the caller's concern: what state to re-emit, when, and where a replay starts are application decisions, and the caller can already express them with append + truncate_prefix. And nothing uses the API: not paros (its stores bracket their own checkpoints with record kinds and do not call append_checkpoint), not the example sim beyond exercising it, not anything else.

paros's owner decided on 2026-10-06 that:

  1. The journal API is append, read and truncate. Nothing else. moonpool-journal has no checkpoint concept. Its two-copy metadata stays.
  2. Checkpoints and compaction belong to the stateful actors above the journal API.

Scope

  • Remove Journal::append_checkpoint, Journal::checkpoint, Recovery::checkpoint, JournalError::CheckpointTooLarge.
  • Remove the checkpoint flag and entry count from the slot and entry records (layout.rs, segment.rs, scan.rs); the count field returns to reserved. The format definition changes, so the format version is bumped (v4 → v5) and a v4 segment is refused rather than misread.
  • Remove everything that exists only for them: the checkpoint tests in tests/journal.rs, the crate docs' # Checkpoints section, the book's journal chapter section (book/src/part5-building-on-top/08-journal.md), llms.md if it mentions them, and the checkpointing third of the example sim (crates/moonpool-sim-examples/src/journal.rs).
  • No deprecation, no compatibility shim (AGENTS.md: delete).

Not in scope

Everything else #305 brought (fresh-block batches, reserved slot records, cut flag, SegmentGap, peek_meta, the owner-scoped fault surface) stays.

Done means

The API is append / read / truncate; fmt, clippy (incl. --no-default-features and wasm32), nextest, rustdoc, mdbook build book, the journal crash loops (JOURNAL_CRASH_SEEDS=3000) and cargo xtask sim run journal all green.

Refs #302, PR #305.

Activity

  1. PierreZ commented on Nov 11, 2026

    @PierreZ
    OwnerAuthor

    This work is done on main (checked at 2d05273). This issue can be closed.

    Evidence:

    • grep -rni checkpoint crates/moonpool-journal crates/moonpool-sim-examples book/src/llms.md finds nothing. There is no append_checkpoint, no Journal::checkpoint, no Recovery::checkpoint, no JournalError::CheckpointTooLarge and no FLAG_CHECKPOINT.
    • The crate was rewritten as a CLSTORE journal. The files that held the checkpoint fields (layout.rs, scan.rs) do not exist now. The public API of Journal is create, open, peek_meta, read, replay, verify_records and commit of a Batch (put, clear, truncate_prefix, set_meta).
    • The on-disk format is a new one (format.rs, VERSION = 3), with no checkpoint flag or count.
    • The book chapter book/src/part5-building-on-top/08-journal.md names checkpoints only to say that there are none: "there is no fold at boot and no checkpoint ... There are no snapshots and no compaction."
    • The example sim crates/moonpool-sim-examples/src/journal.rs has no checkpoint part.

    Generated by Claude Code

  2. PierreZ commented on Nov 11, 2026

    @PierreZ
    OwnerAuthor

    This work is done. Commit 8874a7a (feat(moonpool-journal)!: rewrite as a position-keyed CLSTORE journal, PR #308) rewrote the journal from zero, and the rewrite has no checkpoint concept.

    I checked main at 2d05273:

    • grep -i checkpoint crates/moonpool-journal crates/moonpool-sim-examples/src/journal* finds nothing. There is no append_checkpoint, no Journal::checkpoint, no Recovery::checkpoint and no CheckpointTooLarge.
    • The API in crates/moonpool-journal/src/journal.rs is create, open, read, replay and commit of a Batch (write, clear and truncate_prefix).
    • The on-disk format is new (format.rs, VERSION = 3 of the new layout), with no checkpoint flag or count.
    • The book chapter (book/src/part5-building-on-top/08-journal.md) says only that the journal stores state, so there is "no fold at boot and no checkpoint".

    Closed at Pierre's request.


    Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions