Repository navigation
Add ReadBufferFromS3RequestsCut profile event and stop 04812 from counting cut requests - #124701
Conversation
…nting cut requests Since ClickHouse#119730, `ReadBufferFromS3::initialize` cuts every request of an S3 disk to one buffer fill while the process-wide `Disk` connection group holds at least `disk_connections_soft_limit` connections. Whether a request is cut therefore depends on the rest of the server, and nothing recorded that it happened. `04812_prewhere_fragmented_ranges_s3_read_requests` asserts `S3ReadRequestsCount < 20`. In `Stateless tests (arm_asan_ubsan, azure, parallel)` every MergeTree table lives on the `azure` disk, which shares the `Disk` group with `s3_disk`; bursts of Azure disk reads held the group at 5600-6000 connections for 10-15 s, and both failing runs (PR 115050 and PR 123894) fell inside such a window: 1723-1843 GETs instead of 2-6 for the same bytes, with 0 errors. The new event is incremented exactly where `cut_request_end` is set, and the test now bounds only the requests that were not cut: `S3ReadRequestsCount < 20 + ReadBufferFromS3RequestsCut`. Under the cut, the uncut requests are the ones the test is about (one per requested range), so a read bound that advances per fragment still fails the test, with and without the soft limit. Without pressure the event is 0 and the assertion is unchanged. Validated with `disk_connections_soft_limit = 1` on a local server: the old test fails 5/5 with the CI diff, the new one passes 50/50; with the default limit the new test passes 50/50 with the same request counts as before. Related: ClickHouse#115050 (comment) Related: ClickHouse#119730 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding) plus my own cold review (1 nit).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261008-174300 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-7:20261008-164800 |
|
Workflow [PR], commit [743e625] Summary: ✅
AI ReviewSummaryThis PR adds Final Verdict
LLVM Coverage ReportMeasured on commit 743e625.
Changed lines: Changed C/C++ lines covered: 10/10 (100.00%) · Uncovered code |
… event and stop 04812 from counting cut requests Counts the S3 disk reads cut to one buffer fill by ClickHouse#119730, so the cut is visible in `system.events` and `query_log`. `04812_prewhere_fragmented_ranges_s3_read_requests` asserts a request count and fails when the server is above the soft limit; it now excludes cut requests. Upstream: ClickHouse#124701 Upstream merge commit: 35cab67 Commits of the upstream pull request: - 743e625 Add ReadBufferFromS3RequestsCut profile event and stop 04812 from counting cut requests Adaptation for antalya-26.8: - None: applied as is. (cherry picked from commit 35cab67) Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
Related: #115050 (comment)
Related: #119730
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Added profile event
ReadBufferFromS3RequestsCut: the number of requests to S3 disks cut to one buffer fill because the connection group of the disks was at or abovedisk_connections_soft_limit.Description
04812_prewhere_fragmented_ranges_s3_read_requestsassertsS3ReadRequestsCount < 20. It failed inStateless tests (arm_asan_ubsan, azure, parallel)on #115050 and #123894: 1723-1843 GETs instead of 2-6 for the same bytes, 0 errors, and every rerun passed.Cause. Since #119730,
ReadBufferFromS3::initializecuts each request to one buffer fill while the server-wideDiskconnection group is at or abovedisk_connections_soft_limit(5000). In the azure job every MergeTree table is on theazuredisk, which shares that group withs3_disk, and the job'smetric_logshows the group at 5600-6000 connections for 10-15 s around both failing queries. So the count depends on other queries, and nothing showed that a request was cut.Change. A new profile event
ReadBufferFromS3RequestsCut, incremented where a request is cut, and the test bound becomesS3ReadRequestsCount < 20 + ReadBufferFromS3RequestsCut. Requests that are not cut must still stay below 20, so the test keeps its power. The.referenceis unchanged.Validation (debug build,
s3_diskon a local MinIO):disk_connections_soft_limit = 1: the unmodified test fails 5/5 with the CI diff (about 1700 requests, all but 7 and 3 of them cut); the fixed test passes 50/50.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/124701]
Version info
26.10.1.1978-master(included in26.10and later)