Repository navigation
fix(db): harden interrupted restore recovery across schema versions and descriptor cleanup (#1219) - #1220
Open
khaira777 wants to merge 1 commit into
Open
fix(db): harden interrupted restore recovery across schema versions and descriptor cleanup (#1219)#1220khaira777 wants to merge 1 commit into
khaira777 wants to merge 1 commit into
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…nd descriptor cleanup (#1219)
khaira777
force-pushed
the
fix/restore-recovery-hardening
branch
from
October 18, 2026 18:41
185b2d0 to
14835ba
Compare
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
Fixes #1219
This PR resolves two recovery and integrity issues identified during regression review:
Interrupted restore recovery across schema versions (PR fix(main): optimize order search with indexed candidate retrieval #1204 follow-up):
recoverInterruptedDatabaseReplacementvalidated prepared replacement snapshots against the current build's schema reference.buildIdealSchemaDbandrunMigrationsto accept an optionaltargetVersion. Cache recovery schema references per version incachedSchemaRecoveryReferences. InisHealthyDatabaseFile, retrievegetRecoverySchemaReference(schemaVersion)so that historical databases are verified against their respective valid schema definitions before being restored and migrated forward.Backup descriptor-close cleanup (PR fix(db): eliminate redundant restore snapshot staging and ensure temp cleanup #1193 follow-up):
materializeRestoreSource, iffs.closeSync(sourceFd)threw infinally, the newly created temporary snapshot directory was leaked without invoking its cleanup callback.closeSyncfailures infinally), the staged snapshot directory is cleaned up immediately.Verification
npm run test:backup(All tests passed, including new descriptor-close cleanup and v114 recovery tests)npm run test:schema-health(passed)npm run test:schema-reference-cache(passed)npm run test:upgrade-path(passed)node scripts/ci/check-changed-format.cjs --base origin/main(passed)npm run lint(0 errors)npm run build(passed)npm run docs:check(passed)