[fix](mtmv) Avoid mutating excluded trigger tables#62984
Merged
morrySnow merged 2 commits intoMay 11, 2026
Merged
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
seawinde
reviewed
May 8, 2026
Contributor
Author
|
run buildall |
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
Contributor
|
/review |
Contributor
There was a problem hiding this comment.
Review result: no additional blocking issues found.
Critical checkpoint conclusions:
- Goal/test coverage: The PR fixes
isMTMVPartitionSyncso it no longer mutates caller-owned excluded trigger table sets, and the added FE unit test covers the immutableImmutableSet.of()caller path from force-consistent rewrite. - Scope/clarity: The production change is small and focused; it copies the input set once and uses the local mutable set for derived PCT exclusions.
- Concurrency/lifecycle/config/compatibility: No new concurrency, lifecycle, configuration, persistence, protocol, or storage compatibility concerns found.
- Parallel paths: The reviewed callers (
MTMVRewriteUtil, refresh partition calculation, and task freshness check) continue to use the same helper, so the fix applies to the relevant paths without needing separate changes. - Error handling/data correctness: Existing
AnalysisExceptionbehavior and partition/base-table sync semantics are preserved; the change avoids anUnsupportedOperationExceptionwithout hiding sync failures. - Performance/observability: The extra set copy is bounded by the excluded table set size and is not a hot-path concern for this check; no additional logs or metrics are needed.
- Tests: I reviewed the added unit test path but did not run the FE test suite in this Actions review session.
User focus: No additional user-provided review focus was specified.
morrySnow
approved these changes
May 11, 2026
zhaorongsheng
pushed a commit
to zhaorongsheng/doris
that referenced
this pull request
Jun 4, 2026
Problem Summary: isMTMVPartitionSync adds followed PCT tables into the excluded trigger table set while checking partition sync. Some callers pass immutable sets, such as the force-consistent rewrite path using ImmutableSet.of(), so partitioned MTMVs can fail with UnsupportedOperationException before the sync check finishes. Copy the input set into a local mutable set before adding derived PCT tables, avoiding mutation of caller-owned state and supporting immutable inputs. --------- Co-authored-by: yangtao555 <yangtao555@jd.com>
This was referenced Jun 15, 2026
yiguolei
pushed a commit
that referenced
this pull request
Jun 16, 2026
… (#64519) pr: #62984 commitId: 464d89c Backport #62984 to branch-4.1. This fixes isMTMVPartitionSync mutating caller-owned excluded trigger table sets. The backport adapts the upstream TableNameInfo change to branch-4.1, which still uses TableName in this code path, by copying the input set into a local mutable Set<TableName> before adding followed PCT tables. Conflict resolution: - fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPartitionUtil.java: kept branch-4.1 TableName API and applied the local-copy behavior. - fe/fe-core/src/test/java/org/apache/doris/mtmv/MTMVPartitionUtilTest.java: adapted the upstream immutable-set test to branch-4.1 JMockit style and TableName type. Tests: - git diff --check upstream/branch-4.1..HEAD - ./run-fe-ut.sh --run org.apache.doris.mtmv.MTMVPartitionUtilTest Co-authored-by: foxtail463 <foxtail463@gmail.com> Co-authored-by: yangtao555 <yangtao555@jd.com>
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.
intro by #56745
Problem Summary:
isMTMVPartitionSync adds followed PCT tables into the excluded trigger table set while checking partition sync. Some callers pass immutable sets, such as the force-consistent rewrite path using ImmutableSet.of(), so partitioned MTMVs can fail with UnsupportedOperationException before the sync check finishes. Copy the input set into a local mutable set before adding derived PCT tables, avoiding mutation of caller-owned state and supporting immutable inputs.