Repository navigation
fix(backups): order snapshots by their time, not their name - #107
Merged
Merged
Conversation
consolebook-prerestore-<stamp>.db sorted after every consolebook-<stamp>.db, so after any restore the set-aside database stayed "newest" for good: catch-up copied it off the server, copy status read current while later copies failed, and retention pruned real backups ahead of it. Closes #105 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
Full local proof on Generated by Claude Code |
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.
Primary Issue
Closes #105
Problem And Outcome
backup::snapshots_insorted by file name.restoresets the old database aside asconsolebook-prerestore-<stamp>.db, which sorts after everyconsolebook-<stamp>.db(p>2). So after any restore, the set-aside database was "newest" for good:catch_upcopied it off the server;currentwhile later daily copies failed;doctornamed it as the latest snapshot. This was observed in the upgrade: take a validated backup before migrating the database #94 drill on 0.1.0.Snapshots now sort by the UTC stamp at the end of their name, then by name. Every consumer of "newest" or "oldest" follows from that one function: listing, retention, copy status, catch-up, and doctor.
Changes
backup.rs:snapshots_insorts bysnapshot_order(), which takes the stamp after the last-, then the full name.tests/snapshot_order.rs: fixture files written out of order: an early backup, a pre-restore set-aside, and a later backup.behind, andcatch_upcopies the latest backup, not the set-aside one.CHANGELOG.md: Unreleased → Fixed.Correction rung: 1. One ordering function owns "oldest first" for every caller.
Verification
found.sort(), all three new tests fail.cargo fmt --checkandcargo clippy --workspace --all-targets -- -D warningsare clean.snapshot_order,backup_copy, andbackup_restorepass.Review And Merge Notes
consolebook-premigration-<stamp>.dband relies on this ordering, so this merges first.🤖 Generated with Claude Code
https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
Generated by Claude Code