Folks, question about StarRocks 4.1.1 - how do I...
# questions-and-troubleshooting
a
Folks, question about StarRocks 4.1.1 - how do I get AUTO refresh mode on for iceberg-driven materialized views? There seems to be support in the code for AUTO mode, and I see the article on medium mentioning refresh_mode="auto" (even @Rocky gives a similar output), yet, when I try to enable it, I am getting an error that only INCREMENTAL or PCT is supported - no AUTO.
r
In StarRocks 4.1.1, the
refresh_mode
property was indeed introduced to support more flexible refresh strategies for materialized views (MVs), particularly those driven by Iceberg and Paimon append-only tables. However, you are likely encountering one of the following restrictions or behavior changes introduced in this version: 1. You cannot
ALTER
a legacy MV to
AUTO
According to the documentation for StarRocks 4.1, you cannot change an existing "legacy" materialized view (one created without
refresh_mode
or using the default
PCT
mode) to
AUTO
or
INCREMENTAL
using an
ALTER
statement. * The Fix: You must drop and recreate the materialized view from scratch with the property defined in the
PROPERTIES
block. 2. Validation Constraints in v4.1.1 The error message
only INCREMENTAL or PCT is supported - no AUTO
suggests a validation check. While
AUTO
is supported in the broader v4.1 release, StarRocks 4.1.1 specifically introduced several "hardening" changes for these new modes: * Query Rewrite: Automatic query rewrite is currently disabled for MVs with
refresh_mode
set to
INCREMENTAL
or
AUTO
(Issue #74512). This was done to ensure correctness while the Incremental MV (IMV) engine matures. * Command Rejection: In 4.1.1, both
FORCE
refresh and partition-specific refreshes are explicitly rejected for
AUTO
or
INCREMENTAL
MVs. If you are trying to trigger a refresh with these flags while setting the mode, it may fail. 3. Syntax and Requirements Ensure your creation syntax looks like this (noting that
refresh_mode
is a property):
Copy code
sql
CREATE MATERIALIZED VIEW iceberg_mv
PARTITION BY dt
REFRESH DEFERRED MANUAL -- Or ASYNC
PROPERTIES (
    "refresh_mode" = "AUTO"
)
AS 
SELECT ... FROM iceberg_catalog.db.table;
Key prerequisites for
AUTO
mode:
* Table Type: Currently only supported for Iceberg and Paimon tables. * Data Operations: The base table must be append-only. If StarRocks detects
UPDATE
,
DELETE
, or
OVERWRITE
operations, an
AUTO
MV will typically fall back to
PCT
(partition-level) refresh. * Default Mode: You can check or change the global default via the FE configuration
default_mv_refresh_mode
(default is
pct
). Recommended Next Steps: If you are definitely on 4.1.1 and the
CREATE
statement still fails with that specific error, it is possible that the
AUTO
mode was temporarily restricted in your specific build due to the identified rewrite/correctness issues. You can try setting it to
INCREMENTAL
to see if that is accepted; if
INCREMENTAL
works but
AUTO
doesn't, it confirms a validation restriction in that patch. For the most up-to-date status on when
AUTO
(and query rewrite for it) will be fully re-enabled, it is best to check the StarRocks GitHub Issues or ask in the community Slack. Referencesadministration/management/FE_configuration.md
a
That's exactly what I am talking about - issue is on create - created an issue ticket for that https://github.com/StarRocks/starrocks/issues/75306