Skip to content

branch-4.0: [fix](insert) reset skipAuth on all INSERT OVERWRITE exit paths - #66410

Merged
morningman merged 1 commit into
apache:branch-4.0from
CalvinKirs:4.0-66383
Aug 4, 2026
Merged

branch-4.0: [fix](insert) reset skipAuth on all INSERT OVERWRITE exit paths#66410
morningman merged 1 commit into
apache:branch-4.0from
CalvinKirs:4.0-66383

Conversation

@CalvinKirs

Copy link
Copy Markdown
Member

…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)
@CalvinKirs
CalvinKirs requested a review from morningman as a code owner August 4, 2026 03:24
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@CalvinKirs

Copy link
Copy Markdown
Member Author

run buildall

@CalvinKirs

Copy link
Copy Markdown
Member Author

run feut

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 33.33% (1/3) 🎉
Increment coverage report
Complete coverage report

@morningman
morningman merged commit e7d6abc into apache:branch-4.0 Aug 4, 2026
27 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants