Repository navigation
Checkpoints: a copy of the store that opens as it was, at /_checkpoint - #48
Merged
Merged
Conversation
This was referenced Oct 4, 2026
A copy of a running store's files is not a backup: they are copied at different moments, and the WAL isn't fsynced, so a volume snapshot is like a power cut. The adapter's Checkpoint copies the store between writes instead: it holds writes back until the DB has written out the latest (about 1.1 s with the defaults), syncs it and copies its files, and copies memdb's records, not its files, into a fresh memdb. Reads go on. The copy opens with db_path set to it, as after a clean shutdown, and with the same keyring only. Stats reports the store's messages, disk bytes and memdb records. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
POST /_checkpoint on the monitor port, with "Authorization: Bearer <CHECKPOINT_TOKEN>", writes a checkpoint of the store into CHECKPOINT_DIR/ckpt-<UTC time>, for a volume snapshot or a copy elsewhere; restoring is starting a server with -db_path at it and the same keyring. Off unless CHECKPOINT_DIR and CHECKPOINT_TOKEN are both set; one at a time, one per CHECKPOINT_MIN_MINUTES (10); the newest CHECKPOINT_KEEP (3) are kept. /_metrics reports the store's size, and the checkpoints' last success, failures and duration. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #47 (metrics). Ported from
unitdb_internal(its commits cb89818 and d334636).Why: a copy of a running store's files isn't a backup. The files are copied at different moments, and the WAL isn't fsynced, so a volume snapshot is like a power cut.
Checkpoint(adapter):db_pathset to it, as after a clean shutdown, and only with the same keyring.POST /_checkpointon the monitor port, withAuthorization: Bearer <CHECKPOINT_TOKEN>, writes one intoCHECKPOINT_DIR/ckpt-<UTC time>:CHECKPOINT_MIN_MINUTES(10).CHECKPOINT_KEEP(3) are kept.Restoring is starting a server with
-db_pathat the checkpoint and the same keyring.Metrics:
/_metricsreports the store's size, and the checkpoints' last success, failures and duration.Tests: the adapter's
TestCheckpoint(writes going on during the checkpoint),TestCheckpointAndStats, and the e2e restore drillTestBackupCheckpointRestores.🤖 Generated with Claude Code