mview: REFRESH WITH ASYNC MODE is rejected although declared supported
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
### 1. Minimal reproduce step (Required)
On a TiDB cluster, run the following SQL:
~~~sql
DROP DATABASE IF EXISTS mview_async_repro;
CREATE DATABASE mview_async_repro;
USE mview_async_repro;
CREATE TABLE t_base (
id INT PRIMARY KEY,
v INT
);
CREATE MATERIALIZED VIEW LOG ON t_base (id, v) PURGE IMMEDIATE;
CREATE MATERIALIZED VIEW mv_async (v, cnt)
REFRESH FAST
AS
SELECT v, COUNT(*) AS cnt
FROM t_base
GROUP BY v;
INSERT INTO t_base VALUES (1, 10);
REFRESH MATERIALIZED VIEW mv_async COMPLETE;
INSERT INTO t_base VALUES (2, 20);
REFRESH MATERIALIZED VIEW mv_async WITH ASYNC MODE FAST;
~~~
The last statement was executed after the baseline refresh had succeeded.
### 2. What did you expect to see? (Required)
REFRESH MATERIALIZED VIEW ... WITH ASYNC MODE FAST should be accepted. The refresh request should be submitted for asynchronous/background execution, with the corresponding state/history observable in the MView refresh metadata tables. After the refresh completes, the materialized view should match the base query result.
### 3. What did you see instead (Required)
The statement is rejected before the refresh starts:
~~~text
ERROR 1105 (HY000): refresh materialized view: WITH ASYNC MODE is not supported yet
~~~
This prevents users from using the declared asynchronous refresh syntax.
This is different from #66784, which is about read visibility while an asynchronous refresh is running; this issue is about the asynchronous refresh statement itself being rejected.
### 4. What is your TiDB version? (Required)
The issue was reproduced directly on 2026-08-07 with:
~~~text
Release Version: v8.5.4-20260801-4572f61
Edition: Enterprise
Git Commit Hash: 4572f61eeee5ca022ad73d8fcd7595e012247b8
~~~
Contributor guide
Research direction
Run the supplied SQL reproduction on the stated TiDB version and confirm that COMPLETE refresh succeeds while ASYNC MODE FAST is rejected. Then trace the materialized-view refresh path and inspect the refresh metadata tables to understand the existing state and history behavior. Done means the ASYNC MODE FAST statement is accepted, submitted for background execution, and leaves observable metadata showing a completed refresh with the expected view result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100