8000 docs: durability, recovery and operations guide (#398) by adityamukho · Pull Request #536 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

docs: durability, recovery and operations guide (#398) - #536

Merged
adityamukho merged 1 commit into
v3from
docs/398-durability-guide
Oct 11, 2026
Merged

adityamukho merged 1 commit into
v3from
docs/398-durability-guide

Conversation

@adityamukho
Copy link 8000
Copy Markdown
Collaborator

Adds docs/DURABILITY.md for issue #398, for teams running Minigraf where data loss matters:

  • What survives a process crash and a power loss under SyncMode::Full and SyncMode::Normal, and what durability assumes about storage. Also covers BrowserDb and WASI.
  • Opening after a crash: meta selection, WAL replay, cutting the torn tail, and the cost of each step. Open is constant time; WAL replay is linear in pending facts; v7 upgrade is a one-time cost.
  • Failures while running (WAL-007, STG-046), including an automatic checkpoint that fails after its transaction is already committed.
  • Filesystems, locking, containers and rolling updates, and Windows mandatory locks.
  • Backups: offline copy, volume snapshot, or online fact_log → LogWriter from the running process. Restore steps.
  • verify() / rebuild_indexes(), upgrading from v2.x and rolling back, and upgrades within v3.x (STG-034).
  • A table of storage and WAL errors grouped by what to do: retry, fix the setup, reopen, use another version, repair, or restore.
  • Known limitations.

The guide is linked from the README, and ROADMAP, CHANGELOG and TEST_COVERAGE are updated. The docs site publishes it as a snapshot page (since = "v3.0.0") in a companion minigraf-docs PR. That PR must merge after this one because the site reads origin/v3.

Found while writing it: #535. Restoring an older .graph next to a newer .wal opens without an error and replays the WAL on top, which leaves a gap in the history. The restore steps remove any .wal first, and the known limitations list #535.

Test: online_backup_while_writes_continue in tests/log_writer_test.rs runs the documented online backup. It copies a live read-write handle that has an uncheckpointed transaction while another thread writes past the automatic checkpoint threshold. It checks that the backup verifies, holds exactly what the log returned and has the expected counter, and that every concurrent write reaches the source file after the log is dropped.

Full suite: 1418 passed, 0 failed, 10 ignored. cargo clippy --all-features -D warnings and cargo fmt --check are clean.

#398 stays open until v3.0.0 ships (durability label).

🤖 Generated with Claude Code

https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h

docs/DURABILITY.md covers what survives a process crash and a power loss
under SyncMode::Full and Normal, recovery on open and its cost, failures
while running (WAL-007, STG-046), supported filesystems and containers,
backups (offline copy, volume snapshot, fact_log into LogWriter from the
running process) and restores, verify() and rebuild_indexes(), upgrading
from v2.x and rolling back, a retry/reopen/restore table for the storage
errors, and known limitations. Linked from the README; published on the
docs site as a snapshot page.

A log-writer test runs the documented online backup while another thread
writes past the automatic checkpoint threshold.

Writing it found #535 (a .wal from a later checkpoint is replayed onto an
older .graph without an error); the restore steps remove any .wal first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
@codecov
codecov Bot commented Oct 11, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit aa4af86 into v3 Oct 11, 2026
24 checks passed
@adityamukho
adityamukho deleted the docs/398-durability-guide branch October 11, 2026 04:16
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

0