Repository navigation
Fix flaky test_storage_iceberg_concurrent (thread-pool oversubscription) - #108075
Merged
alexey-milovidov merged 1 commit intoJun 22, 2026
Conversation
test_concurrent_reads runs 25 concurrent SELECT * queries against one accumulating Iceberg table while 15 Spark writers commit in parallel, for 10 rounds. By default each SELECT fans out to ~max_threads (number of CPU cores) internal read threads, so 25 simultaneous readers request hundreds of threads at once. On a loaded CI shard this oversubscribes the global thread pool: a single SELECT either gets starved past the 300s client receive_timeout (Return code 159, seen on the asan/db-disk/old-analyzer 5/6 shard for PRs ClickHouse#100651 and ClickHouse#108049 and on master) or the server rejects the query outright with CANNOT_SCHEDULE_TASK (Code 439, threads=1000, jobs=1000). Pin max_threads=4 on the concurrent SELECT so the readers' aggregate thread demand stays bounded. This does not change what the test verifies: all 25 readers still race all 15 writers across every round and the exact row-count assertion is unchanged. Only the per-query intra-read parallelism is capped, which is irrelevant to concurrent-read snapshot consistency. Locally reproduced both directions on a debug build: pristine test fails at round 2 with CANNOT_SCHEDULE_TASK; with the cap it passes all 10 rounds (~150s).
Collaborator
Author
Pre-PR validation gate
Session id: cron:clickhouse-worker-slot-0:20260621-210600 |
Collaborator
Author
|
cc @divanik — could you review this test-only fix? It pins |
alexey-milovidov
approved these changes
Jun 21, 2026
Contributor
|
Workflow [PR], commit [0ee2f26] Summary: ✅ AI ReviewSummary
Final Verdict
|
Contributor
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 300 line(s), 19 function(s) across 104 file(s) · Details Top files
|
alexey-milovidov
added a commit
that referenced
this pull request
Jun 22, 2026
Refresh CI on the latest master. The previous run's only red was a job-level cancellation of the 'Integration tests (amd_asan_ubsan, db disk, old analyzer, 5/6)' shard: test_storage_iceberg_concurrent/test_concurrent_reads hung (the known-flaky test fixed by the merged #108075), which pushed the shard past its time budget and caused the operation to be canceled; the in-flight tests (test_huge_concurrent_restore, test_azure_disk_unreachable) were marked failed only because of that cancellation. This merge brings in #108075 (merged after the previous merge-base), which fixes the hang. The DESCRIBE parser code is unchanged - master touched none of the PR's three files, so the merge net diff vs master is exactly those files, byte-identical.
1 task
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
Refresh CI on the latest master. The previous run's only red was a job-level cancellation of the 'Integration tests (amd_asan_ubsan, db disk, old analyzer, 5/6)' shard: test_storage_iceberg_concurrent/test_concurrent_reads hung (the known-flaky test fixed by the merged ClickHouse#108075), which pushed the shard past its time budget and caused the operation to be canceled; the in-flight tests (test_huge_concurrent_restore, test_azure_disk_unreachable) were marked failed only because of that cancellation. This merge brings in ClickHouse#108075 (merged after the previous merge-base), which fixes the hang. The DESCRIBE parser code is unchanged - master touched none of the PR's three files, so the merge net diff vs master is exactly those files, byte-identical.
10 of 30 tasks
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Requested by @ alexey-milovidov on #108049 (the failure surfaced there; the ZSTD PR is unrelated).
test_storage_iceberg_concurrent::test_concurrent_readsruns 25 concurrentSELECT *queries against one accumulating Iceberg table while 15 Spark writers commit in parallel, for 10 rounds. By default eachSELECTfans out to ~max_threads(number of CPU cores) internal read threads, so 25 simultaneous readers request hundreds of threads at once. On a loaded CI shard this oversubscribes the global thread pool and a singleSELECTgets starved past the 300s clientreceive_timeout:Timeout-class failures (30d), all on the loaded
amd_asan_ubsan, db disk, old analyzer, 5/6shard:Waited for 333 secondsFix: pin
max_threads=4on the concurrentSELECTso the readers' aggregate thread demand stays bounded. This does not change what the test verifies: all 25 readers still race all 15 writers across every round and the exact row-count assertion is unchanged. Only the per-query intra-read parallelism is capped, which is irrelevant to concurrent-read snapshot consistency.Local validation (debug build, both directions):
Code 439 CANNOT_SCHEDULE_TASK (threads=1000, jobs=1000)(the same oversubscription, manifesting as outright thread-pool exhaustion on my 96-core box).max_threads=4: PASSES all 10 rounds, twice (147s, 152s).Version info
26.6.1.1096