Repository navigation
Preserve backup file identity during cleanup and retention - #698
Merged
Merged
Conversation
Pin selected backup files and their parent directory through stale cleanup and retention deletion. Move verified candidates into a private quarantine without overwriting competing entries; retain changed or uncertain files and restore failures for recovery. Reject duplicate selection names and fail collection before deletion when descriptors or memory are unavailable. Add 48 real-filesystem regression cases and register them in the existing unit build and integration/sanitizer jobs. On origin/main 8927bc8, cleanup fails 22/29 cases and retention fails 13/19; the isolated fix passes all 48 under Debug ASan/UBSan. Tests use owned temporary trees, without services or legacy shared-path fixtures. Unsupported atomic filesystem operations fail conservatively; this does not protect against privileged external writers mutating held inodes.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Depends on #701; merge the shared CI cleanup first. This branch includes that exact shared commit so its workflow changes disappear from this PR after #701 merges. Suite membership is declared beside the tests in CMake; this fix has no independent workflow edits. All three remaining fix branches merge cleanly with each other.
Backup cleanup and retention could delete a replacement file after selecting a pathname. Retention also reopened names after sorting, losing the identity of the selected backups.
Hold file and directory descriptors through selection and deletion. Move selected entries into a private directory without replacing existing entries, verify their identity there, and restore or retain uncertain files. Abort retention before deletion if the full inventory cannot be collected.
main: 35 of 48 cases fail before the fix; all 48 pass with ASan/UBSan afterward. Tests use private temporary trees and cover replacements, symlinks, allocation/descriptor failures, restoration conflicts, and normal cleanup/retention.ctest --test-dir build/focused-debug --output-on-failure -R '^test_db_backup_(cleanup|retention_identity)$'.Retention temporarily uses one descriptor per eligible backup. Atomic no-replace moves require Linux/filesystem support; unsupported operations retain files and report incomplete cleanup. Uncertain artifacts may require manual recovery. Held descriptors do not prevent another writer from modifying an already-open inode.
Extracted independently from #693; no foundation framework or policy exceptions. Hosted CI is required before merge.
Revalidated after updating from main and adopting the shared CI suites: focused ASan/UBSan regressions pass, and CTest labels select the existing suite plus only this PR’s regressions.