Skip to content

feat(backfill): --resume a halted run from the store's last checkpoint - #4

Merged
Mctursh merged 2 commits into
masterfrom
feat/resume-backfill-run
Sep 4, 2026
Merged

Mctursh merged 2 commits into
masterfrom
feat/resume-backfill-run

Conversation

@Mctursh

@Mctursh Mctursh commented Sep 4, 2026

Copy link
Copy Markdown
Owner

A long replay that halted (bad block, vote mismatch, crash) had to start over from the snapshot. Now the disk store periodically commits a checkpoint and --resume picks up from it, no snapshot needed.

A checkpoint is the buffered accounts plus the bank-hash roll state (2048 LE lattice bytes ++ the 32-byte hash, same layout as the snapshot trailer) written in one durable redb commit, so a crash can't land the accounts without the checkpoint that describes them.

What makes it sound is checkpoint_mode: once seeding is done, put() stops auto-flushing and flush() no-ops, leaving checkpoint_flush as the only committer. The redb therefore never holds writes past the last checkpoint, so resuming from it can't replay onto state that already moved. The checkpoint is written even when a chunk buffered nothing, so a no-write chunk still advances the slot.

A long replay that halted (bad block, vote mismatch, crash) had to start over
from the snapshot. Now the disk store periodically commits a checkpoint and
--resume picks up from it, no snapshot needed.

A checkpoint is the buffered accounts plus the bank-hash roll state (2048 LE
lattice bytes ++ the 32-byte hash, same layout as the snapshot trailer) written
in one durable redb commit, so a crash can't land the accounts without the
checkpoint that describes them.

What makes it sound is checkpoint_mode: once seeding is done, put() stops
auto-flushing and flush() no-ops, leaving checkpoint_flush as the only
committer. The redb therefore never holds writes past the last checkpoint, so
resuming from it can't replay onto state that already moved. The checkpoint is
written even when a chunk buffered nothing, so a no-write chunk still advances
the slot.
@Mctursh
Mctursh merged commit 7bfdb28 into master Sep 4, 2026
2 checks passed
@Mctursh
Mctursh deleted the feat/resume-backfill-run branch September 4, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant