Skip to content

Enable kill_throw_if_noop by default - #125968

Merged
arsenmuk merged 2 commits into
ClickHouse:masterfrom
Kryst4lskyxx:enable-kill-throw-if-noop
Oct 21, 2026
Merged

arsenmuk merged 2 commits into
ClickHouse:masterfrom
Kryst4lskyxx:enable-kill-throw-if-noop

Conversation

@Kryst4lskyxx

@Kryst4lskyxx Kryst4lskyxx commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Local KILL QUERY and KILL MUTATION can silently do nothing when a WHERE condition is wrong. Report these mistakes by default.

Changes

  • Enable kill_throw_if_noop by default and keep the previous default with compatibility below 26.11.
  • Update the setting and KILL documentation.
  • Add SQL tests for the default, explicit opt-out, dry runs, and compatibility.

Closes: #123272
Related: #83348
Related: #85023

Changelog category (leave one):

  • Backward Incompatible Change

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

kill_throw_if_noop now defaults to true. A compatibility level below 26.11 keeps the previous default.


Workflow [PR]
Sync PR [sync-upstream/pr/125968]

Version info

  • Merged into: 26.11.1.397-master (included in 26.11 and later)

@clickhouse-gh clickhouse-gh Bot added comp-settings Settings & configuration infrastructure (server/user/query settings, profiles). external Author is not a member of the ClickHouse organization labels Oct 15, 2026
@arsenmuk arsenmuk self-assigned this Oct 16, 2026
@arsenmuk arsenmuk added the can be tested Allows running workflows for external contributors label Oct 16, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a27c7f5]

Summary: ✅


AI Review

Summary

Enables kill_throw_if_noop by default for local KILL QUERY and KILL MUTATION, preserves the previous default with compatibility below 26.11, and updates source documentation and regression coverage. No actionable findings against PR head a27c7f587a21122cefc2d900f524912ebc0bdfdb.

Final Verdict

✅ Approve.

@clickhouse-gh clickhouse-gh Bot added the pr-backward-incompatible Pull request with backwards incompatible changes label Oct 16, 2026
@arsenmuk

Copy link
Copy Markdown
Member

@Kryst4lskyxx thank you for your contribution!

Could you please condense the PR description - it's too bloated now.

  1. Let's make changelog much shorter - it should briefly state what's changing, and the compatibility level.
  2. The PR body should be heavily compacted, I suggest using format:
Motivation
<1 max 2 short sentences explaining why we're making the change>

Changes
- <1 sentence per each logical change>
- <e.g. flipped default of `kill_throw_if_noop` to true>
- <e.g. added tests to ensure compatibility levels work as expected

@Kryst4lskyxx

Copy link
Copy Markdown
Contributor Author

Thanks @arsenmuk, I have updated the description.

@clickhouse-gh clickhouse-gh Bot added comp-query-execution Runtime execution pipeline, processors, vectorized operators, resource management during execution. and removed comp-settings Settings & configuration infrastructure (server/user/query settings, profiles). labels Oct 16, 2026
@Kryst4lskyxx

Copy link
Copy Markdown
Contributor Author

@arsenmuk one test failed due to floating tags; pushed 5083b17 to try to fix this.

@Kryst4lskyxx

Copy link
Copy Markdown
Contributor Author

@arsenmuk 5083b17 introduces more failures, so I reverted this change. Could you please help take a look?

@arsenmuk

Copy link
Copy Markdown
Member

@Kryst4lskyxx don't worry about the failed build - it's not caused by your change. Once #126269 is merged, you'll just rebase and it'll be fine.

Though could you please check the failed Style check, it's connected to the change. We need to update SettingsChangesHistory.cpp, there should be bunch of similar changes for you to pick some inspiration from.

Kryst4lskyxx added a commit to Kryst4lskyxx/ClickHouse that referenced this pull request Oct 16, 2026
Add the current-version history record required by the style check and
preserve the original `26.10` introduction with its disabled default.
Update the SQL regression test to check the `26.10` to `26.11`
compatibility boundary.

Review: ClickHouse#125968 (comment)
CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125968&sha=f7bf1134847ab6e9de8c537be532bdb0ff69bf9d&name_0=PR&name_1=Style%20check
Related: ClickHouse#125968
Kryst4lskyxx added a commit to Kryst4lskyxx/ClickHouse that referenced this pull request Oct 16, 2026
Bring the merged build fix into the PR while preserving the existing
branch history and the `26.11` compatibility record.

Related: ClickHouse#126269
Related: ClickHouse#125968
@Kryst4lskyxx
Kryst4lskyxx force-pushed the enable-kill-throw-if-noop branch from 8fcff8e to 520a648 Compare October 16, 2026 23:51
Kryst4lskyxx added a commit to Kryst4lskyxx/ClickHouse that referenced this pull request Oct 16, 2026
Add the current-version history record required by the style check and
preserve the original `26.10` introduction with its disabled default.
Update the SQL regression test to check the `26.10` to `26.11`
compatibility boundary.

Review: ClickHouse#125968 (comment)
CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125968&sha=f7bf1134847ab6e9de8c537be532bdb0ff69bf9d&name_0=PR&name_1=Style%20check
Related: ClickHouse#125968
@Kryst4lskyxx

Copy link
Copy Markdown
Contributor Author

Thanks @arsenmuk, rebased and updated the settings history also.

@clickhouse-gh

clickhouse-gh Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing a27c7f587 with master c8a410bb9 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

8 translation units recompiled, 19 s compile time in total, 6 of them have a recent master baseline.

Translation units without a recent master baseline:

  • src/Core/Settings.cpp: 12.2 s

Job report

Report unmatched local `KILL QUERY` and `KILL MUTATION` statements instead
of silently accepting them. Preserve the explicit opt-out and record the
default change for `compatibility` with versions before 26.10.

Update the registered documentation and add stateless regression coverage
for the implicit default, opt-out, dry runs, and compatibility boundary.

Closes: ClickHouse#123272
Add the current-version history record required by the style check and
preserve the original `26.10` introduction with its disabled default.
Update the SQL regression test to check the `26.10` to `26.11`
compatibility boundary.

Review: ClickHouse#125968 (comment)
CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125968&sha=f7bf1134847ab6e9de8c537be532bdb0ff69bf9d&name_0=PR&name_1=Style%20check
Related: ClickHouse#125968
@Kryst4lskyxx
Kryst4lskyxx force-pushed the enable-kill-throw-if-noop branch from 520a648 to a27c7f5 Compare October 19, 2026 02:01

@arsenmuk arsenmuk left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kryst4lskyxx thank you for addressing the comments, it's all good now

@arsenmuk
arsenmuk enabled auto-merge October 19, 2026 11:44
Kryst4lskyxx added a commit to Kryst4lskyxx/ClickHouse that referenced this pull request Oct 20, 2026
Add the current-version history record required by the style check and
preserve the original `26.10` introduction with its disabled default.
Update the SQL regression test to check the `26.10` to `26.11`
compatibility boundary.

Review: ClickHouse#125968 (comment)
CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125968&sha=f7bf1134847ab6e9de8c537be532bdb0ff69bf9d&name_0=PR&name_1=Style%20check
Related: ClickHouse#125968
auto-merge was automatically disabled October 20, 2026 02:43

Head branch was pushed to by a user without write access

@Kryst4lskyxx
Kryst4lskyxx force-pushed the enable-kill-throw-if-noop branch 2 times, most recently from eef0eb2 to a27c7f5 Compare October 20, 2026 06:33
@arsenmuk
arsenmuk enabled auto-merge October 20, 2026 08:30
@arsenmuk
arsenmuk added this pull request to the merge queue Oct 21, 2026
Merged via the queue into ClickHouse:master with commit 9a58b96 Oct 21, 2026
528 of 529 checks passed
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 21, 2026
thevar1able pushed a commit to actueleai/ClickHouse that referenced this pull request Oct 22, 2026
Since ClickHouse#123341, DROP WORKLOAD purges the dropped workload's queue: the
running query's memory reservation fails with MEMORY_RESERVATION_FAILED
("Allocation queue is about to be destructed") at its next sync, which
for sleepEachRow(1) with max_block_size 1 is the end of the current
1-second step. When that step ends between DROP WORKLOAD and KILL QUERY,
the query is already gone and KILL matches nothing. That was a silent
no-op until ClickHouse#125968 made kill_throw_if_noop default to true; now KILL
writes NOTHING_TO_KILL to stderr and the test fails with
"having stderror" (master 3eecd13, amd_asan_ubsan).

The failing purge is the intended behavior (covered by the
MemoryReservationDropWorkloadFailsRunningAllocation gtest), so the test
now tolerates a no-op KILL with kill_throw_if_noop = false, the idiom of
03824 and 04726, and its comment states the current semantics. Other
KILL errors still reach stderr, and the reservation is destroyed after
the purge in both branches.

Validated on the CI binaries of 3eecd13: amd_asan_ubsan unmodified
7/30 FAIL (all NOTHING_TO_KILL), fixed 50/50 OK with 17 runs in the
drop-failed branch; amd_debug with sleep 1.5 injected between DROP and
KILL: unmodified 10/10 FAIL, fixed 10/10 OK; plain fixed 50/50 OK.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-query-execution Runtime execution pipeline, processors, vectorized operators, resource management during execution. external Author is not a member of the ClickHouse organization pr-backward-incompatible Pull request with backwards incompatible changes pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable kill_throw_if_noop by default

3 participants