Repository navigation
Conversation
…base Documents HarperFast/harper#3121: restore stages and opens the backup first, refuses one it cannot read with the database untouched, needs free space for a second copy, and cannot restore a database whose directory is a symlink. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unt points and 5.3.2 Docs review round 1: blobs are neither staged nor checked, so the guarantee is stated for the database files only; the refusal message is quoted by its phrase rather than as a suffix; staging space is the backup's restored size and a rerun after an interrupted swap can need one more copy; mount-point database directories are refused like symlinks (core change in the same PR); and the 5.3 release notes record the behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fit, and when the aside copy goes Docs review round 2: an online restore stages while the database keeps serving, and writes made then are replaced; a staging copy without headroom is refused with 507 (core change in the same PR); an uninterrupted restore removes the set-aside copy itself; a crash during staging leaves the files untouched but blocked; the refusal comes from "the restore", which offline has no job; and the release note counts transaction logs in the space needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hind Docs review round 3: a refused rerun over an unfinished restore leaves the database blocked, not untouched; a rerun needs no more room than the first attempt (core drops the stale candidate first); repointing a symlinked path after an interrupted restore needs an offline rerun before the next start; the overview's worked example describes staging; and a restore refused before the database closes leaves its subscriptions running (verified against the branch). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-721 This preview will update automatically when you push new commits. |
Gemini review on #721: per the docs guidelines, a patch-level behavior change to an existing operation carries a `changed` VersionBadge, under the heading and inline in the Limitations item. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-721 This preview will update automatically when you push new commits. |
The restore no longer stages a copy. It verifies the backup in place (checksums, transaction logs, every table file's format and compression, and the presence of a declared blob snapshot) before it deletes the database, needs no extra disk space, and checks after an online restore has closed the database. Moves the release note from 5.3 to 5.4 to match the harper PR's milestone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
restore_backup checks a backup before replacing the database
…un exception Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-721 This preview will update automatically when you push new commits. |
| From the CLI with the server stopped, `target_database=<name>` restores into a separate database instead of overwriting the source. The target must not already exist, or must be an empty directory; Harper picks the new database up on the next start. | ||
|
|
||
| If a restore is interrupted before it completes (crash, power loss), Harper marks the database as incompletely restored and refuses to load it on the next start, logging an incomplete-restore error. Recover by rerunning `restore_backup` for the same database and `backup_id` — do not try to load or hand-repair the directory. | ||
| If a restore is interrupted (crash, power loss) after it has started replacing the database's files, Harper marks the database as incompletely restored and refuses to load it on the next start, logging an incomplete-restore error. Recover by rerunning `restore_backup` for the same database and `backup_id` — do not try to load or hand-repair the directory. As of v5.4.0, an interruption while the backup is still being checked leaves the database untouched and unmarked, and it loads normally on the next start. |
There was a problem hiding this comment.
Please limit the final sentence's restart guarantee to a database that was not already marked incomplete. For example, after one restore fails during replacement, rerun restore_backup and interrupt it during verification: the earlier marker remains, so the database still cannot load on restart. The core feature branch preserves that marker when claiming a recovery attempt; verification does not clear it. This is code-trace evidence, not an executed crash test.
Suggested wording: “An interruption during verification leaves the destination's files and any preexisting incomplete-restore marker unchanged; a previously healthy database loads normally on the next start.” Apply the same qualification to the interruption sentence in release-notes/v5-lincoln/5.4.md:65, so both pages agree with the recovery exception already described in reference/backups/operations.md:119.
There was a problem hiding this comment.
Addressed in 17ea4eabb093.
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-721 This preview will update automatically when you push new commits. |
⊙ Problem
HarperFast/harper#3121: Verify a backup can be read before restore_backup replaces the database changes
restore_backupin 5.4. The backup reference still describes the old close-purge-restore order, and this PR's earlier text described a staging design the core PR has since dropped.💡 Solution
Document the shipped behavior as of v5.4.0: a restore checks the backup in place before it deletes the database, needs no extra disk, and refuses a backup this version can't read with the database left as it was. An online restore's check runs inside its downtime, and a crash during the check leaves the database loadable.
🔧 Changes
reference/backups/operations.md,restore_backup.verify_backupdoes not open tables.reference/backups/overview.md.release-notes/v5-lincoln/5.4.md. A "Restore Checks a Backup Before Deleting the Database" entry under a new Backups section. The 5.3 entry this PR used to add is removed.✅ Verification
npm run buildpasses andnpm run format:checkis clean.dataLayer/rocksdbBackup.ts, marker timing indataLayer/restoreMarker.ts, and the design note indataLayer/DESIGN.md. The core branch's unit tests cover each claim (refusals online and offline, check-after-close, a loadable database after a claim that never reached the purge).🤖 Generated by Anthropic Claude (Opus); posted via @cb1kenobi.
Related PRs: none found
Complexity: easy
Review-Coverage: authored=claude; ran=gemini,cursor-composer,codex,cursor-muse; adjudicated=domain; declined=cursor-grok,cursor-kimi; rounds=5; full=3 @ 7fb257e
Review-Attention: skim ~2m (decisions: summary-brevity) @ 7fb257e