[Enhancement] Reject cross-mode ALTER for materialized view refresh_mode#72380
Merged
Merged
Conversation
Per the IMV V1 PRD, ALTER MATERIALIZED VIEW SET refresh_mode is restricted to no-op (same mode). Switching between INCREMENTAL and PCT is not supported in V1; the recovery path for changing refresh_mode is drop-and-recreate. Production: - AlterMVJobExecutor.alterMVRefreshMode: replace the IVMAnalyzer re-validation block with a single early gate. If the original mode differs from the target mode, throw with a clear error pointing at drop-and-recreate. Same-mode ALTERs still go through the applier so the persisted property and the in-memory currentRefreshMode stay in sync (relied on by the helper-driven test path). - The IVMAnalyzer.rewrite call here re-walked the MV's defining query to recompute IVM eligibility on every ALTER refresh_mode. Since same-mode ALTER is the only allowed transition under the new gate, that re-validation is no longer reachable; remove it (and the now unused import) to keep the method narrow and avoid a known AST mutation leak in the analyzer's catch-and-fallback path. Tests: - testChangeMVRefreshMode1 (AUTO MV): AUTO -> INCREMENTAL now expects rejection (cross-mode). The companion AUTO -> AUTO leg still expects rejection at the PropertyAnalyzer layer (PR2). Mode stays AUTO throughout. - testChangeMVRefreshMode3 (INCREMENTAL MV): adds a third leg asserting INCREMENTAL -> PCT is rejected, the gap PR6 was created to close. - testChangeMVRefreshMode2/6/7 already expect failure for their cross-mode legs and continue to pass under the simpler rule. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Youngwb <yangwenbo_mailbox@163.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Contributor
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
Contributor
[FE Incremental Coverage Report]✅ pass : 6 / 6 (100.00%) file detail
|
Contributor
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
stephen-shelby
approved these changes
Apr 30, 2026
HangyuanLiu
approved these changes
Apr 30, 2026
Contributor
|
@Mergifyio backport branch-4.1 |
Contributor
✅ Backports have been createdDetails
|
Merged
24 tasks
robd003
pushed a commit
to robd003/starrocks
that referenced
this pull request
May 6, 2026
…ode (StarRocks#72380) Signed-off-by: Youngwb <yangwenbo_mailbox@163.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
xiangguangyxg
pushed a commit
to xiangguangyxg/starrocks
that referenced
this pull request
May 7, 2026
…ode (StarRocks#72380) Signed-off-by: Youngwb <yangwenbo_mailbox@163.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: xiangguangyxg <xiangguangyxg@gmail.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.
Why I'm doing:
What I'm doing:
ALTER MATERIALIZED VIEW SET refresh_mode is restricted to no-op (same mode). Switching between INCREMENTAL and PCT is not supported; the recovery path for changing refresh_mode is drop-and-recreate.
Production:
Tests:
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: