Skip to content

Cherry pick #103252 to 26.4: Add SYSTEM PAUSE VIEW and SYSTEM PAUSE VIEWS - #104389

Merged
robot-clickhouse merged 5 commits into
backport/26.4/103252from
cherrypick/26.4/103252
May 8, 2026
Merged

robot-clickhouse merged 5 commits into
backport/26.4/103252from
cherrypick/26.4/103252

Conversation

@robot-clickhouse

Copy link
Copy Markdown
Member

Original pull-request #103252

Do not merge this PR manually

This pull-request is a first step of an automated backporting.
It contains changes similar to calling git cherry-pick locally.
If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.

The check results does not matter at this step - you can safely ignore them.

Troubleshooting

If the conflicts were resolved in a wrong way

If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

nikitamikhaylov and others added 5 commits April 21, 2026 12:57
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
`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
Add SYSTEM PAUSE VIEW and SYSTEM PAUSE VIEWS
@robot-clickhouse robot-clickhouse added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request labels May 8, 2026
@robot-clickhouse
robot-clickhouse merged commit fcf1112 into backport/26.4/103252 May 8, 2026
179 of 182 checks passed
@robot-clickhouse
robot-clickhouse deleted the cherrypick/26.4/103252 branch May 8, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants