Skip to content

refactor(backup): one walk for restore and verify - #98

Closed
ewanc26 wants to merge 1 commit into
mainfrom
work/dedupe-backup-walk
Closed

ewanc26 wants to merge 1 commit into
mainfrom
work/dedupe-backup-walk

Conversation

@ewanc26

@ewanc26 ewanc26 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Refs #89 (the backup.c part; blob_store.c is not in this PR).

What this changes

src/repo/backup.c: restore and verify repeated the same loop (header check, entry header, 100 MB cap, allocation, read, CRC). backup_walk now does that once and passes each verified entry to a visitor. Restore writes the entry; verify does nothing extra.

Verification

  • Full ctest: 46/46 pass, same as baseline. test_backup covers the walk.
  • Error codes and the cleanup order are unchanged; the caller closes the file on every path.

Not done here: blob_store.c's blob_copy_file does a bounded streaming copy with a different shape (chunked, size-checked against a declared length), so sharing it with backup.c needs a separate design. Route helpers and the account registry are also still open under #89.

Docs

None needed: internal refactor with no user-facing behaviour, config or API change.

Changelog: none — internal refactor, no behaviour change.

🤖 Generated with Claude Code

Restore and verify repeated the same loop: check the header, read each
entry and its data, enforce the size cap, check the CRC. backup_walk now
does that once and hands each verified entry to a visitor. Restore writes
the entry; verify does nothing beyond the checks the walk already makes.

Error codes and the order of cleanup are unchanged, and the file is
closed by the caller on every path. test_backup passes, and the full
ctest run is 46/46.

Refs #89

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@ewanc26

ewanc26 commented Oct 16, 2026

Copy link
Copy Markdown
Owner Author

Replaced by #108 (branch renamed to type/slug so the flow / conventions check passes). Same commits and content.

@ewanc26 ewanc26 closed this Oct 16, 2026
@ewanc26
ewanc26 deleted the work/dedupe-backup-walk branch October 16, 2026 17:14
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