Skip to content

[Refactor] Hide AUTO refresh mode from user surface (backport #72313)#72343

Merged
wanpengfei-git merged 1 commit into
branch-4.1from
mergify/bp/branch-4.1/pr-72313
Apr 29, 2026
Merged

[Refactor] Hide AUTO refresh mode from user surface (backport #72313)#72343
wanpengfei-git merged 1 commit into
branch-4.1from
mergify/bp/branch-4.1/pr-72313

Conversation

@mergify

@mergify mergify Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Why I'm doing:

What I'm doing:

AUTO is intentionally not exposed to users; the implementation is preserved internally and will be revived in a later phase. This change rejects user-facing input of refresh_mode = "auto" on both CREATE and ALTER paths, while leaving the internal AUTO machinery (RefreshMode.AUTO enum, MVHybridRefreshProcessor, etc.) fully intact.

Production:

  • IVMAnalyzer.getRefreshMode (CREATE path): reject "auto" with a clear SemanticException. Tighten error reporting for any invalid refresh_mode value.
  • PropertyAnalyzer.analyzeRefreshMode (ALTER path): reject "auto" with the same message. Update the error to list only the supported values (INCREMENTAL, PCT) instead of the full enum.
  • AlterMVJobExecutor.alterMVRefreshMode: idempotency check now also considers the in-memory currentRefreshMode, not just the persisted property. Without this, an ALTER could no-op when the two are out of sync, leaving the in-memory mode stale.

Tests:

  • MVTestBase.createMaterializedViewWithRefreshMode: add a test-only bypass for "auto" — create through the SQL path with INCREMENTAL (which exercises the IVMAnalyzer the same way), then promote the in-memory currentRefreshMode to AUTO. If the query is not IVM-eligible, fall back to PCT, mirroring real AUTO behavior. The persisted property remains "incremental" so DDL regeneration during ALTER ACTIVE does not feed "auto" back through the analyzer.
  • Update unit tests where ALTER to "auto" was expected to succeed; they now expect failure with the mode unchanged.
  • Add explicit rejection tests for CREATE and ALTER.
  • Skip 3 SQL integration tests that exercise AUTO end-to-end through SQL (test_ivm_with_iceberg_{auto,delete,expire_snapshots}). Files remain on disk so they can be revived when AUTO ships in a later phase.

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
    • This pr needs auto generate documentation
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.1
    • 4.0
    • 3.5
    • 3.4

This is an automatic backport of pull request #72313 done by [Mergify](https://mergify.com).

@mergify mergify Bot added the conflicts label Apr 29, 2026
@mergify

mergify Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of 9668fe7 has failed:

On branch mergify/bp/branch-4.1/pr-72313
Your branch is up to date with 'origin/branch-4.1'.

You are currently cherry-picking commit 9668fe7c2e.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   fe/fe-core/src/main/java/com/starrocks/alter/AlterMVJobExecutor.java
	modified:   fe/fe-core/src/main/java/com/starrocks/common/util/PropertyAnalyzer.java
	modified:   fe/fe-core/src/main/java/com/starrocks/sql/analyzer/mv/IVMAnalyzer.java
	modified:   fe/fe-core/src/test/java/com/starrocks/sql/optimizer/rule/transformation/materialization/MVTestBase.java
	modified:   test/lib/skip.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   fe/fe-core/src/test/java/com/starrocks/alter/AlterMaterializedViewTest.java
	both modified:   fe/fe-core/src/test/java/com/starrocks/analysis/RefreshMaterializedViewTest.java

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@wanpengfei-git wanpengfei-git enabled auto-merge (squash) April 29, 2026 08:57
@mergify mergify Bot closed this Apr 29, 2026
auto-merge was automatically disabled April 29, 2026 08:57

Pull request was closed

@mergify

mergify Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr

@Youngwb Youngwb reopened this Apr 29, 2026
@wanpengfei-git wanpengfei-git enabled auto-merge (squash) April 29, 2026 08:59
Signed-off-by: Youngwb <yangwenbo_mailbox@163.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
(cherry picked from commit 9668fe7)
@Youngwb Youngwb force-pushed the mergify/bp/branch-4.1/pr-72313 branch from 44d9dca to a437301 Compare April 29, 2026 09:35
@wanpengfei-git wanpengfei-git merged commit e873c66 into branch-4.1 Apr 29, 2026
30 checks passed
@wanpengfei-git wanpengfei-git deleted the mergify/bp/branch-4.1/pr-72313 branch April 29, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants