Add atomic managed rollback for database replacement - #4960
Merged
Conversation
# Conflicts: # src/CodeIndex/Cli/ConsoleUi.cs # src/CodeIndex/Cli/DbCommandRunner.ArgumentParser.cs # src/CodeIndex/Cli/DbCommandRunner.cs
Widthdom
marked this pull request as ready for review
July 28, 2026 19:55
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.
Summary
--no-backup.cdidx db restore-backups --restore <id>with non-mutating dry-run, bounded manifest parsing, SHA-256 and schema validation, free-space checks, atomic replacement, and rollback preservation on failure.Validation
dotnet format CodeIndex.sln --verify-no-changes --no-restoredotnet build CodeIndex.sln -c Debug --no-restore(0 warnings, 0 errors)dotnet build CodeIndex.sln -c Release --no-restore(0 warnings, 0 errors)origin/mainsync, ReleaseIssue4857ManagedRestoreBackupTestsandConsoleUiTests: 292/292 passed on both net8.0 and net9.0dotnet run --project tools/CodeIndex.Changelog -- check(38 fragments validated)cdidx status --check --json(index_matches_workspace: true, no failed checks)Documentation and changelog
USER_GUIDE.md,DEVELOPER_GUIDE.md, andTESTING_GUIDE.md.changelog.d/unreleased/4857.fixed.md, with English/Japanese release notes and references to the prior rollback/retention issues.Follow-up candidates
Fixes #4857