Repository navigation
Add SYSTEM PAUSE VIEW and SYSTEM PAUSE VIEWS - #103252
Conversation
Unlike `SYSTEM STOP VIEW`, which cancels the currently running refresh, `SYSTEM PAUSE VIEW` only prevents future refreshes from starting and lets the ongoing refresh complete normally. Undone by `SYSTEM START VIEW`. Plumbed through the existing action-lock machinery by adding a new `ActionLocks::ViewRefreshPause` block type that dispatches to `RefreshTask::pause` (stop-without-interrupt). `SYSTEM START VIEW` now drops both the `ViewRefresh` and `ViewRefreshPause` locks so it uniformly undoes both `STOP` and `PAUSE`. Made-with: Cursor
|
Workflow [PR], commit [4946102] Summary: ❌
AI ReviewSummaryThis PR adds ClickHouse Rules
Final VerdictStatus: ✅ Approve |
|
Implements a part of #102707 |
`SYSTEM PAUSE VIEWS` / `SYSTEM START VIEWS` operate server-wide, so a parallel test that issues `SYSTEM START VIEWS` would race with this test's assertion that all its views are in the `Disabled` state. Observed in flaky check at https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=103252&sha=b0daef3f630d999968660b722401fc27ddd48ecb&name_0=PR&name_1=Stateless+tests+%28amd_asan_ubsan%2C+flaky+check%29 (PR: #103252) Also shrink the slow-refresh workload from 20 rows to 5 rows so the test stays well under the 180s flaky-check limit. Made-with: Cursor
`RefreshTask::stop` used `std::exchange(stop_requested, true)` as an early-return guard. After my previous commit, `RefreshTask::pause` also sets this flag, so a `SYSTEM STOP VIEW` issued after `SYSTEM PAUSE VIEW` would hit the early return and skip `interruptExecution`, leaving the in-flight refresh to run to completion — regressing the documented `STOP VIEW` semantic. Keep the guard only for the reschedule call, and always call `interruptExecution` (which is already idempotent via `execution.interrupt_execution`). Added a regression test for the PAUSE-then-STOP sequence. Review: #103252 (comment) Made-with: Cursor
LLVM Coverage Report
Changed lines: 75.00% (63/84) | lost baseline coverage: 34 line(s) · Uncovered code |
|
@groeneai, this PR was merged by @nikitamikhaylov in violation of our rules - with red CI. I hope this is the last time someone merges with red CI! Our CI is sacred, and we obey its rules. Now we have tech debt: #104130 and #104129 In both of these issues, please link to the corresponding fixes. |
|
@alexey-milovidov — done. Linked fixes on both tech-debt issues per your directive:
(Posted by groeneai — ClickHouse CI worker. session=cron:clickhouse-ci-task-worker:20260505-194500) |
…IEWS (#104139) * Add SYSTEM PAUSE VIEW / SYSTEM PAUSE VIEWS Unlike `SYSTEM STOP VIEW`, which cancels the currently running refresh, `SYSTEM PAUSE VIEW` only prevents future refreshes from starting and lets the ongoing refresh complete normally. Undone by `SYSTEM START VIEW`. Plumbed through the existing action-lock machinery by adding a new `ActionLocks::ViewRefreshPause` block type that dispatches to `RefreshTask::pause` (stop-without-interrupt). `SYSTEM START VIEW` now drops both the `ViewRefresh` and `ViewRefreshPause` locks so it uniformly undoes both `STOP` and `PAUSE`. Made-with: Cursor * Test: mark 04105_system_pause_view as no-parallel and speed up `SYSTEM PAUSE VIEWS` / `SYSTEM START VIEWS` operate server-wide, so a parallel test that issues `SYSTEM START VIEWS` would race with this test's assertion that all its views are in the `Disabled` state. Observed in flaky check at https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=103252&sha=b0daef3f630d999968660b722401fc27ddd48ecb&name_0=PR&name_1=Stateless+tests+%28amd_asan_ubsan%2C+flaky+check%29 (PR: #103252) Also shrink the slow-refresh workload from 20 rows to 5 rows so the test stays well under the 180s flaky-check limit. Made-with: Cursor * Fix: SYSTEM STOP VIEW must cancel refresh even after SYSTEM PAUSE VIEW `RefreshTask::stop` used `std::exchange(stop_requested, true)` as an early-return guard. After my previous commit, `RefreshTask::pause` also sets this flag, so a `SYSTEM STOP VIEW` issued after `SYSTEM PAUSE VIEW` would hit the early return and skip `interruptExecution`, leaving the in-flight refresh to run to completion — regressing the documented `STOP VIEW` semantic. Keep the guard only for the reschedule call, and always call `interruptExecution` (which is already idempotent via `execution.interrupt_execution`). Added a regression test for the PAUSE-then-STOP sequence. Review: #103252 (comment) Made-with: Cursor --------- Co-authored-by: Nikita Mikhailov <[email protected]> Co-authored-by: Nikita Mikhaylov <[email protected]> Co-authored-by: Michael Kolupaev <[email protected]>
Backport #103252 to 26.2: Add SYSTEM PAUSE VIEW and SYSTEM PAUSE VIEWS
Cherry pick #103252 to 26.4: Add SYSTEM PAUSE VIEW and SYSTEM PAUSE VIEWS
Backport #103252 to 26.4: Add SYSTEM PAUSE VIEW and SYSTEM PAUSE VIEWS
Cherry pick #103252 to 26.3: Add SYSTEM PAUSE VIEW and SYSTEM PAUSE VIEWS
#104562) Co-authored-by: robot-clickhouse <[email protected]>
…3252 Backport ClickHouse#103252 to 26.4: Add SYSTEM PAUSE VIEW and SYSTEM PAUSE VIEWS
Adds new control queries for refreshable materialized views:
Unlike
SYSTEM STOP VIEW,SYSTEM PAUSE VIEWdoes not interrupt the currently running refresh — the in-flight refresh is allowed to finish and only subsequent refreshes are prevented. Undone bySYSTEM START VIEW/SYSTEM START VIEWS, which now clear both the stopped and paused states.Plumbed through the same action-lock path as
SYSTEM STOP VIEWvia a newActionLocks::ViewRefreshPausethat dispatches toRefreshTask::pause(stop-without-interrupt).Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Added
SYSTEM PAUSE VIEW [db.]nameandSYSTEM PAUSE VIEWSqueries for refreshable materialized views. UnlikeSYSTEM STOP VIEW,SYSTEM PAUSE VIEWdoes not interrupt the currently running refresh — the in-flight refresh is allowed to complete and only subsequent refreshes are prevented. Undone bySYSTEM START VIEWorSYSTEM START VIEWS, which now uniformly clear both the stopped and paused states.Documentation entry for user-facing changes
Made with Cursor
Version info
26.4.3.8,26.3.13.12,26.2.18.7