[core] Fail drop branch DDL when the branch directory cannot be deleted - #10238
Open
LuciferYang wants to merge 1 commit into
Open
LuciferYang wants to merge 1 commit into
LuciferYang wants to merge 1 commit into
Conversation
dropBranch caught the IOException from deleting the branch directory, logged it at INFO and returned normally, so the DDL reported success while the branch directory and all its data still existed, and a later create of the same branch name failed unexpectedly. Rethrow like the sibling createBranch methods do. Assisted-by: GLM-5.3
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.
Purpose
FileSystemBranchManager.dropBranchcaught theIOExceptionfrom deleting the branch directory, logged it at INFO, and returned normally, so the DDL reported success while the branch directory and its data still existed. A later create of the same branch name then failed unexpectedly with "already exists".This rethrows the failure as a
RuntimeException, the same way the siblingcreateBranch,renameBranch, andfastForwardmethods in this class already do, so the drop-branch DDL fails when the directory cannot be deleted. The pre-existingcheckArgument(branchExists(...))guard is unchanged, so dropping a branch that is already absent still surfaces the "doesn't exist" error rather than a delete failure.This closes #10237.
Tests
Added
FileSystemBranchManagerTest.testDropBranchFailsWhenDeleteFails: it stubsFileIO.deleteto throwIOException, assertsdropBranchrethrows the failure, and asserts the branch directory is left in place.API and Format
No.
Documentation
No.