pingcap / pingcap/tidb

mview: Dashboard Refresh History returns common.bad_request when query range is large and history volume is high

Open
#67,639 0 comments 0 reactions 0 assignees View on GitHub
component/mview feature/developing severity/moderate type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)

Observed on 2026-04-09.

A minimal repro from the Dashboard side is:

1. Open `Dashboard -> Materialized View -> Refresh History`.
2. Select a broad query scope so the result set becomes large.
For example, in the observed case the page selected many databases and used a large time range such as `Recent 30 day`.
3. Click `Query`.
4. When the refresh history data volume is large enough, the page sends `/materialized_view/list` and the request fails.

This appears to be size-dependent: a larger selection range / more history data can trigger the error.

### 2. What did you expect to see? (Required)

The Dashboard should still be able to return refresh history for large result sets, either by:

- returning paginated history rows successfully, or
- applying a documented limit / validation with a clear and actionable error.

It should not fail with a generic bad request just because the selected range is large and the history row count is high.

### 3. What did you see instead (Required)

The Dashboard page shows an error toast and returns no data.

Observed UI error:

```text
API: /materialized_view/list
common.bad_request
```

Screenshot:

![Dashboard Materialized View Refresh History common.bad_request screenshot](https://gist.githubusercontent.com/jebter/0d4de01008e55ecad55b3fff64146ccc/raw/16850071fcb0c0fbaef2eff9325823179fefc675/mview-dashboard-refresh-history-bad-request.png)

From the user-facing behavior, the failure is triggered when the selected range is broad and the refresh history data volume is large.

### 4. What is your TiDB version? (Required)

I did not preserve the exact output of `SELECT tidb_version()` before reporting this issue, so I cannot provide the exact build string here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.