Repository navigation
fix: let restore-backup finish a restore interrupted between renames - #147
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Important
The recovery path can modify the kept database even when it refuses the restore; check its SQLite sidecars before opening it.
Reviewed changes Reviewed the interrupted-restore recovery path, refusal diagnostics, regression tests, and upgrade guidance.
- Recovery detection: Recognizes a missing database with a backup and exactly one timestamped schema-1 kept file.
- Restore completion: Validates backup integrity and original/backup sidecars, then shares the final rename and directory sync with normal restores.
- Tests and guidance: Adds five recovery tests and documents retry/manual-recovery behavior. All 15 restore tests pass; a temporary targeted reproduction confirmed the preservation issue below and was removed afterward.
gpt-6.1-sol | 𝕏
A read_only connection still creates -wal and -shm beside a WAL-mode file; immutable creates nothing.
xsmyile
force-pushed
the
xsmyile/fix-restore-resume
branch
from
October 6, 2026 22:54
c92edcc to
3e177f3
Compare
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the kept-file preservation fix since the previous review, with the full recovery path as context.
- Refused kept-file sidecars: Checks for WAL, SHM, and journal files before opening the kept database.
- Made the recovery probe immutable: Prevents the schema check from writing the kept file or creating SQLite sidecars while retaining existing probe behavior for other callers.
- Added preservation coverage: Exercises a valid orphan WAL and verifies the precise refusal, unchanged backup/database/WAL bytes, and absence of a newly created SHM file.
All 16 focused restore tests pass. The previous preservation finding is addressed and its thread has been resolved.
gpt-6.1-sol | 𝕏
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.

Finishes the first item of #129: with the database missing, an intact backup and a newest .schema1- that is a schema-1 database, restore-backup does the second rename and leaves every kept file as it is; any other state is refused.