Repository navigation
[fix](fe) Rebuild invalidated MTMV baseline on AUTO refresh - #33
Merged
yujun777 merged 1 commit intoAug 28, 2026
Merged
Conversation
### What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary: Changing excluded_trigger_tables clears the refresh snapshot while leaving a successfully refreshed MTMV in NORMAL state. AUTO refresh could then run the partition freshness check with the new exclusions, incorrectly conclude that no refresh was needed, and leave stale data in the materialized view. Route only non-IVM AUTO refreshes in NORMAL/SUCCESS state without a snapshot directly to COMPLETE so the invalidated baseline is rebuilt, while preserving initial refresh and existing partition refresh behavior.
### Release note
AUTO refresh now rebuilds a successfully established MTMV baseline after it has been invalidated.
### Check List (For Author)
- Test: Unit Test and Regression Test
- ./run-fe-ut.sh --run org.apache.doris.mtmv.MTMVTaskTest
- ./run-regression-test.sh --run -d mtmv_p0 -s test_excluded_trigger_table_mtmv
- Behavior changed: Yes. A non-IVM AUTO refresh rebuilds an invalidated successful baseline with COMPLETE refresh.
- Does this need documentation: No
seawinde
force-pushed
the
fix/trigger-exclude-table-regression
branch
from
August 28, 2026 03:47
4843034 to
34b98d0
Compare
yujun777
pushed a commit
that referenced
this pull request
Sep 1, 2026
### What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary: Changing excluded_trigger_tables clears the refresh snapshot while leaving a successfully refreshed MTMV in NORMAL state. AUTO refresh could then run the partition freshness check with the new exclusions, incorrectly conclude that no refresh was needed, and leave stale data in the materialized view. Route only non-IVM AUTO refreshes in NORMAL/SUCCESS state without a snapshot directly to COMPLETE so the invalidated baseline is rebuilt, while preserving initial refresh and existing partition refresh behavior.
### Release note
AUTO refresh now rebuilds a successfully established MTMV baseline after it has been invalidated.
### Check List (For Author)
- Test: Unit Test and Regression Test
- ./run-fe-ut.sh --run org.apache.doris.mtmv.MTMVTaskTest
- ./run-regression-test.sh --run -d mtmv_p0 -s test_excluded_trigger_table_mtmv
- Behavior changed: Yes. A non-IVM AUTO refresh rebuilds an invalidated successful baseline with COMPLETE refresh.
- Does this need documentation: No
yujun777
pushed a commit
that referenced
this pull request
Sep 2, 2026
### What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary: Changing excluded_trigger_tables clears the refresh snapshot while leaving a successfully refreshed MTMV in NORMAL state. AUTO refresh could then run the partition freshness check with the new exclusions, incorrectly conclude that no refresh was needed, and leave stale data in the materialized view. Route only non-IVM AUTO refreshes in NORMAL/SUCCESS state without a snapshot directly to COMPLETE so the invalidated baseline is rebuilt, while preserving initial refresh and existing partition refresh behavior.
### Release note
AUTO refresh now rebuilds a successfully established MTMV baseline after it has been invalidated.
### Check List (For Author)
- Test: Unit Test and Regression Test
- ./run-fe-ut.sh --run org.apache.doris.mtmv.MTMVTaskTest
- ./run-regression-test.sh --run -d mtmv_p0 -s test_excluded_trigger_table_mtmv
- Behavior changed: Yes. A non-IVM AUTO refresh rebuilds an invalidated successful baseline with COMPLETE refresh.
- Does this need documentation: No
yujun777
pushed a commit
that referenced
this pull request
Sep 3, 2026
### What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary: Changing excluded_trigger_tables clears the refresh snapshot while leaving a successfully refreshed MTMV in NORMAL state. AUTO refresh could then run the partition freshness check with the new exclusions, incorrectly conclude that no refresh was needed, and leave stale data in the materialized view. Route only non-IVM AUTO refreshes in NORMAL/SUCCESS state without a snapshot directly to COMPLETE so the invalidated baseline is rebuilt, while preserving initial refresh and existing partition refresh behavior.
### Release note
AUTO refresh now rebuilds a successfully established MTMV baseline after it has been invalidated.
### Check List (For Author)
- Test: Unit Test and Regression Test
- ./run-fe-ut.sh --run org.apache.doris.mtmv.MTMVTaskTest
- ./run-regression-test.sh --run -d mtmv_p0 -s test_excluded_trigger_table_mtmv
- Behavior changed: Yes. A non-IVM AUTO refresh rebuilds an invalidated successful baseline with COMPLETE refresh.
- Does this need documentation: No
yujun777
pushed a commit
that referenced
this pull request
Sep 3, 2026
### What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary: Changing excluded_trigger_tables clears the refresh snapshot while leaving a successfully refreshed MTMV in NORMAL state. AUTO refresh could then run the partition freshness check with the new exclusions, incorrectly conclude that no refresh was needed, and leave stale data in the materialized view. Route only non-IVM AUTO refreshes in NORMAL/SUCCESS state without a snapshot directly to COMPLETE so the invalidated baseline is rebuilt, while preserving initial refresh and existing partition refresh behavior.
### Release note
AUTO refresh now rebuilds a successfully established MTMV baseline after it has been invalidated.
### Check List (For Author)
- Test: Unit Test and Regression Test
- ./run-fe-ut.sh --run org.apache.doris.mtmv.MTMVTaskTest
- ./run-regression-test.sh --run -d mtmv_p0 -s test_excluded_trigger_table_mtmv
- Behavior changed: Yes. A non-IVM AUTO refresh rebuilds an invalidated successful baseline with COMPLETE refresh.
- Does this need documentation: No
yujun777
pushed a commit
that referenced
this pull request
Sep 3, 2026
### What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary: Changing excluded_trigger_tables clears the refresh snapshot while leaving a successfully refreshed MTMV in NORMAL state. AUTO refresh could then run the partition freshness check with the new exclusions, incorrectly conclude that no refresh was needed, and leave stale data in the materialized view. Route only non-IVM AUTO refreshes in NORMAL/SUCCESS state without a snapshot directly to COMPLETE so the invalidated baseline is rebuilt, while preserving initial refresh and existing partition refresh behavior.
### Release note
AUTO refresh now rebuilds a successfully established MTMV baseline after it has been invalidated.
### Check List (For Author)
- Test: Unit Test and Regression Test
- ./run-fe-ut.sh --run org.apache.doris.mtmv.MTMVTaskTest
- ./run-regression-test.sh --run -d mtmv_p0 -s test_excluded_trigger_table_mtmv
- Behavior changed: Yes. A non-IVM AUTO refresh rebuilds an invalidated successful baseline with COMPLETE refresh.
- Does this need documentation: No
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.
What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary:
Changing
excluded_trigger_tablesclears the refresh snapshot while leaving a successfully refreshed MTMV inNORMAL/SUCCESSstate. A later AUTO refresh can therefore run the partition freshness check against the new exclusions, incorrectly conclude that no partition needs refreshing, and leave stale data in the materialized view.Root cause: In
MTMVTask.buildAttempts(), AUTO refresh did not distinguish an initial MTMV without a snapshot from a previously successful MTMV whose snapshot had been invalidated.MTMVTask.javaNORMAL/SUCCESSstate without a snapshot directly to COMPLETE.MTMVTaskTest.javaThis reuses the existing MTMV state and refresh state. It does not change IVM refresh behavior or the normal partition refresh path.
Release note
AUTO refresh now rebuilds a successfully established MTMV baseline after it has been invalidated.
Check List (For Author)
Test
./run-fe-ut.sh --run org.apache.doris.mtmv.MTMVTaskTest: 49 tests passed../run-regression-test.sh --run -d mtmv_p0 -s test_excluded_trigger_table_mtmv: passed../run-regression-test.sh --run -d mtmv_p0/ivm: 71 of 77 suites passed; the 6 failures are unrelated pre-existing IVM stream cleanup, join event-key type, and explain-plan stability issues. The IVM excluded-trigger-table suite passed.Behavior changed:
Old behavior: AUTO refresh could skip rebuilding an invalidated successful baseline.
New behavior: the affected non-IVM AUTO refresh performs a COMPLETE refresh.
Does this need documentation?
Check List (For Reviewer who merge this PR)