Skip to content

Enforce Keeper component name in code#96051

Merged
antonio2368 merged 18 commits intomasterfrom
enforce-component-name
Feb 26, 2026
Merged

Enforce Keeper component name in code#96051
antonio2368 merged 18 commits intomasterfrom
enforce-component-name

Conversation

@antonio2368
Copy link
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Enforce definition of Keeper component name in code so we have correct info in aggregated_zookeeper_log.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@clickhouse-gh
Copy link
Contributor

clickhouse-gh bot commented Feb 5, 2026

Workflow [PR], commit [faa4053]

Summary:

job_name test_name status info comment
Stateless tests (amd_msan, parallel, 2/2) failure
00953_zookeeper_suetin_deduplication_bug FAIL cidb
Stateless tests (arm_asan, targeted) error

@clickhouse-gh clickhouse-gh bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Feb 5, 2026
@antonio2368 antonio2368 force-pushed the enforce-component-name branch 2 times, most recently from afc1925 to 2c32d52 Compare February 6, 2026 16:52
@antonio2368 antonio2368 force-pushed the enforce-component-name branch from 2c32d52 to 18453e8 Compare February 6, 2026 17:36
@antonio2368 antonio2368 force-pushed the enforce-component-name branch from fa7f728 to 4163639 Compare February 9, 2026 16:00
antonio2368 and others added 7 commits February 10, 2026 10:43
Make ZooKeeper component tracking opt-in via the new
`enforce_keeper_component_tracking` server setting. When enabled,
every ZooKeeper request must have a component name set via
`Coordination::setCurrentComponent`, otherwise a `LOGICAL_ERROR`
exception is thrown. When disabled, requests without a component
name are silently allowed.

The setting is wired through `ZooKeeperArgs` and propagated in
`Context` for both main and auxiliary ZooKeeper connections,
including on config reload. Enabled by default in CI stateless
tests and integration tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Port public-file changes from ClickHouse/clickhouse-private#48520
that add Keeper component tracking to additional code paths across
databases, disks, interpreters, storages, backups, and system tables.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Include `ZooKeeperCommon.h` in files that need access to
`Coordination::setCurrentComponent` for keeper component tracking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@antonio2368 antonio2368 marked this pull request as ready for review February 24, 2026 12:33
`ZooKeeperArgs::operator==` is defaulted and compares all fields,
including `enforce_component_tracking` and
`send_receive_os_threads_nice_value` which are set out-of-band from
server settings rather than from the ZooKeeper XML config. When
`ZooKeeper::configChanged` constructs a fresh `ZooKeeperArgs` from
config, these fields stay at their defaults, causing a permanent
mismatch and forcing an unnecessary ZooKeeper reconnection on every
`SYSTEM RELOAD CONFIG`.

Copy these out-of-band fields from the existing args before comparing.

Also add a `Coordination::setCurrentComponent` call in
`MutatePlainMergeTreeTask::cancel`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@antonio2368 antonio2368 added this pull request to the merge queue Feb 26, 2026
Merged via the queue into master with commit 3ceaee5 Feb 26, 2026
145 of 148 checks passed
@antonio2368 antonio2368 deleted the enforce-component-name branch February 26, 2026 13:45
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Feb 26, 2026
robot-clickhouse-ci-1 added a commit that referenced this pull request Feb 26, 2026
Cherry pick #96051 to 26.2: Enforce Keeper component name in code
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 26, 2026
@robot-clickhouse robot-clickhouse added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Feb 26, 2026
clickhouse-gh bot added a commit that referenced this pull request Feb 26, 2026
Backport #96051 to 26.2: Enforce Keeper component name in code
@JTCunning JTCunning added the comp-keeper ClickHouse Keeper related label Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-keeper ClickHouse Keeper related pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo v26.2-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants