Repository navigation
Set Coordination::setCurrentComponent in prewarmCaches - #98663
Merged
Merged
Conversation
…l tasks The thread pool workers spawned by `prewarmCaches` can end up doing ZooKeeper operations through Keeper metadata storage (e.g. when checking file existence via `MetadataStorageFromKeeper`). These threads did not have the component name set, causing a logical error exception: "Current component is empty, please set it for your scope using `Coordination::setCurrentComponent`". Capture the component name from the calling thread and propagate it to each worker thread via an RAII guard. https://d1k2gkhrlfqv31.cloudfront.net/clickhouse-test-reports-private/json.html?PR=51199&sha=latest&name_0=BackportPR Co-Authored-By: Claude Opus 4.6 <[email protected]>
Coordination::setCurrentComponent in prewarmCaches thread poo…Coordination::setCurrentComponent in prewarmCaches
Contributor
clickhouse-gh Bot
added a commit
that referenced
this pull request
Mar 4, 2026
Backport #98663 to 26.2: Set `Coordination::setCurrentComponent` in `prewarmCaches`
pull Bot
pushed a commit
to AKJUS/ClickHouse
that referenced
this pull request
Sep 29, 2026
…ment job Since ClickHouse#110291, when a ranges refiner is set, MergeTreePrefetchedReadPool runs refinement, the patch-range computation, MergeTreeReadTask::createReaders and the first prefetches as one job on the prefetch pool. The Keeper component is a thread-local, and ThreadPoolCallbackRunnerLocal carries only the thread group across the hop, so the job runs with an empty component, while the same work on the inline path runs under MergeTreeSource::tryGenerate. The job checks skip-index files through IMergeTreeIndex::getDeserializedFormat (from the refiner, from getIndexReadTaskForReadStep and from the text-index reader). When a file is in neither checksums.txt nor skp_idx.packed, the check reaches the disk. On a disk whose metadata storage is Keeper that is a Keeper request, and with enforce_keeper_component_tracking it throws LOGICAL_ERROR "Current component is empty", which aborts debug and sanitizer servers. Capture the enqueuing thread's component and restore it as the job's first statement, as ClickHouse#98663 does for the prewarmCaches pool jobs, so the whole job, including its early return and any exception, runs under the component of the read that scheduled it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The thread pool workers spawned by
prewarmCachescan end up doing ZooKeeper operations through Keeper metadata storage (e.g. when checking file existence viaMetadataStorageFromKeeper). These threads did not have the component name set, causing a logical error exception: "Current component is empty, please set it for your scope usingCoordination::setCurrentComponent".https://d1k2gkhrlfqv31.cloudfront.net/clickhouse-test-reports-private/json.html?PR=51199&sha=latest&name_0=BackportPR
Changelog category (leave one):
Documentation entry for user-facing changes
Version info
26.3.1.38026.2.4.19