Skip to content

Fix Keeper crash on CheckWatch request with an unknown watch type - #130755

Merged
NIKTONIKTO717 merged 1 commit into
masterfrom
fix-87019
Nov 11, 2026
Merged

NIKTONIKTO717 merged 1 commit into
masterfrom
fix-87019

Conversation

@NIKTONIKTO717

@NIKTONIKTO717 NIKTONIKTO717 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Closes: https://github.com/ClickHouse/clickhouse-private/issues/87019

A CheckWatch with a type outside 1..5 made Keeper run off the end of containsWatch and crash. CheckWatch, RemoveWatch and AddWatch with an unknown type now get ZBADARGUMENTS. The check is in processLocal, not the decoder, so Keeper can still replay such a request from its Raft log.

Changelog category (leave one):

  • Critical Bug Fix (crash, data loss, RBAC)

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

Fixed a Keeper crash when a client sends CheckWatch with an unknown watch type. Such requests now get ZBADARGUMENTS.

🤖 Generated with Claude Code


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

Version info

  • Merged into: 26.11.1.1965-master (included in 26.11 and later)
  • Backported to: 26.3.66.2

@clickhouse-gh

clickhouse-gh Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [39445b6]

Summary: ✅


AI Review

Summary

Reviewed #130755 at 39445b6cb8f2942b46de5af4f970170ab3534030. The PR rejects unknown CheckWatch, RemoveWatch, and AddWatch values with ZBADARGUMENTS, preventing undefined behavior in containsWatch while preserving Raft-log decoding. No actionable findings.

Missing context / blind spots
  • ⚠️ The added integration regression was not run locally because this checkout has no built ClickHouse binary. Runtime results were not available from CI at review time; a passing test_keeper_persistent_watches/test.py::test_watch_requests_with_unknown_type would complete runtime validation.
  • ⚠️ The linked private issue was inaccessible. The review relies on the public PR description, current code, and regression test; access to the issue would allow comparison with the original reproducer.
Final Verdict

Status: ✅ Approve. No code changes requested; integration runtime validation remains with CI.

@clickhouse-gh clickhouse-gh Bot added pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! comp-keeper ClickHouse Keeper (Raft-based coordination layer; ZooKeeper replacement) and ZooKeeper client lib... labels Nov 11, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 39445b6cb with master 5252bd271 (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.

Slowest function optimization changes (ThinLTO)

Median per-function time ratio to the master baseline: programs/clickhouse ×0.60, programs/clickhouse-keeper ×0.62 (each binary is linked separately, on a different machine and with different build flags); deltas below are relative to it.

Binary Function Master PR Δ vs median
programs/clickhouse DB::registerFunctionConversion(DB::FunctionFactory&) 5.6 s 12.6 s +9.2 s (+276%)
programs/clickhouse _ZN6detail10static_forITk7is_enumN2DB23AttributeUnderlyingTypeEZNS1_29callOnDictionaryAttributeType… 3.3 s 7.1 s +5.1 s (+256%)
Compile time of recompiled translation units

7 translation units recompiled, 15 s compile time in total, 7 of them have a recent master baseline.

Job report

@antonio2368 antonio2368 self-assigned this Nov 11, 2026
@NIKTONIKTO717
NIKTONIKTO717 added this pull request to the merge queue Nov 11, 2026
Merged via the queue into master with commit cd9725c Nov 11, 2026
187 checks passed
@NIKTONIKTO717
NIKTONIKTO717 deleted the fix-87019 branch November 11, 2026 14:40
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 11, 2026
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Nov 11, 2026
clickhouse-gh Bot added a commit that referenced this pull request Nov 11, 2026
Backport #130755 to 26.8: Fix Keeper crash on `CheckWatch` request with an unknown watch type
clickhouse-gh Bot added a commit that referenced this pull request Nov 11, 2026
Backport #130755 to 26.10: Fix Keeper crash on `CheckWatch` request with an unknown watch type
clickhouse-gh Bot added a commit that referenced this pull request Nov 11, 2026
Backport #130755 to 26.9: Fix Keeper crash on `CheckWatch` request with an unknown watch type
groeneai pushed a commit to groeneai/ClickHouse that referenced this pull request Nov 12, 2026
groeneai pushed a commit to groeneai/ClickHouse that referenced this pull request Nov 12, 2026
groeneai pushed a commit to groeneai/ClickHouse that referenced this pull request Nov 12, 2026
leshikus pushed a commit that referenced this pull request Nov 13, 2026
leshikus pushed a commit that referenced this pull request Nov 13, 2026
leshikus pushed a commit that referenced this pull request Nov 13, 2026
NIKTONIKTO717 added a commit that referenced this pull request Nov 13, 2026
Cherry pick #130755 to 26.3: Fix Keeper crash on `CheckWatch` request with an unknown watch type
robot-clickhouse added a commit that referenced this pull request Nov 13, 2026
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Nov 13, 2026
antonio2368 added a commit that referenced this pull request Nov 16, 2026
Backport #130755 to 26.3: Fix Keeper crash on `CheckWatch` request with an unknown watch type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-keeper ClickHouse Keeper (Raft-based coordination layer; ZooKeeper replacement) and ZooKeeper client lib... pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR 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.

4 participants