branch-4.0: [fix](insert) reset skipAuth on all INSERT OVERWRITE exit paths - #66410
Merged
Conversation
…he#66383) `InsertOverwriteTableCommand` runs its internal partition-replacement work with `ConnectContext.skipAuth=true` for OLAP targets, and clears the flag in a `finally` block. The flag was set *before* that `try` block, so if any statement in between returned early or threw — for example the `@branch`-on-non-iceberg guard, or `recordRunningTableOrException` when the same table already has an overwrite running — the method exited without the `finally` ever running, and `skipAuth` stayed set for the rest of that connection. Move `setSkipAuth(true)` to the first statement *inside* the existing `try` block (keeping the same OLAP-only condition), so it is always paired with the `setSkipAuth(false)` in `finally`. The guards that can throw before that point now run while `skipAuth` is still untouched, so there is nothing to leak. The `finally` is unchanged. Added `InsertOverwriteSkipAuthResetTest`: runs a failing `INSERT OVERWRITE ... @branch` against an OLAP table and asserts `skipAuth` is reset afterwards. It fails on the old code (`expected: <false> but was: <true>`) and passes with this change. - [x] Regression test added - [x] `mvn checkstyle:check -pl fe-core` passes (cherry picked from commit d84b04e)
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
run buildall |
Member
Author
|
run feut |
Contributor
FE Regression Coverage ReportIncrement line coverage |
morningman
approved these changes
Aug 4, 2026
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.
#66383