Repository navigation
Conversation
|
Workflow [PR], commit [adbdae5] Summary: ❌
AI ReviewSummaryThe PR stops additional S3 reads after query timeout or Missing context / blind spots
Final VerdictStatus: ✅ Approve |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes2100 object files changed (+94.75 KiB total), 0 added.
716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units4718 translation units recompiled, 16651 s compile time in total, 4718 of them have a recent master baseline. Median compile-time ratio to the baselines is ×1.06 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio. |
Return explicit query-cancellation exceptions from `ReadBufferFromS3::processException` before incrementing `ReadBufferFromS3RequestsErrors` or logging an S3 failure. Cover the pre-request cancellation path in the S3 integration test. PR: ClickHouse#116257
This comment was marked as outdated.
This comment was marked as outdated.
Mark the non-Poco exception handlers in `QueryStatus` with `Ok:` comments for `catch_all`, and suppress `bugprone-empty-catch` only for the intentionally empty handler. Pointer identity still handles exceptions shared by `copyMutableException`; runtime behavior is unchanged. Related: ClickHouse#116257 CI: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116257&sha=e08ab5b35cf51acf08ad17834417ce09aa9f3764&name_0=PR
Ergus
left a comment
There was a problem hiding this comment.
Please build the cached TIMEOUT_EXCEEDED message with the elapsed time regardless of which thread throws first, and add a test for it.
# Conflicts: # src/Interpreters/ProcessList.h # tests/integration/test_azure_403_handling/test.py
|
|
Use the post-admission execution timer for both the time limit check and the cached timeout exception. Check that both cancellation paths report the same execution time and exclude time spent waiting for admission.
Distinguish an `ABORTED` raised by a merge or mutation cancellation predicate from a storage error. In `ReadBufferFromS3`, classify the caught error before checking cancellation for a retry. Extend the existing `05621_s3_drop_outdated_parts_cancellation` test to stop a background merge before `GetObject` and check its `system.part_log` counters. Review: ClickHouse#116257 (comment) Related: ClickHouse#116257
Use `clickhouse_test_time_left` alongside the 60-second limit when polling `system.part_log`. Fail if the merge record is missing when the wait expires. Related: ClickHouse#116257
Match the test table in the merge query ID before pausing in `ReadBufferFromS3::sendRequest`. This lets unrelated merges issue `GetObject` while the target merge waits for `SYSTEM STOP MERGES`. CI: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116257&sha=7d667375bdd6e0c864fcd92648dce97ec27c5cb4&name_0=PR&name_1=Stateless%20tests%20%28amd_binary%2C%20flaky%20check%29 Related: ClickHouse#116257
Skip the entire `QUERY_WAS_CANCELLED_BY_CLIENT` log record, including its stack trace. The previous line filter removed the exception header but printed constructor frames from `ReadBuffer::cancel` to the test output. Resume exception checks at the next log record so unrelated failures remain visible. Validated shell syntax and 17 filter cases, including all 19 cancellation records from the three CI failures and unexpected-exception cases. CI: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116257&sha=6fa6e70ae03116ca18750f7a9255dfca984f8b49&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20s3%20storage%2C%20targeted%29 Related: ClickHouse#116257
Resolve conflicts in `FailPoint` and `ThreadStatus`, preserving cancellation handling and upstream changes. Related: ClickHouse#116257
Keep the slot registered by upstream so `FiberLocal` compiles again in the fast and tidy builds. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116257&sha=7485ac0177fff950ab5347d154e4823d65cb64ed&name_0=PR Related: ClickHouse#116257
…reading Check cancellation before constructing the rebuild pipeline. Disable parallel replicas and distributed plans for this internal single-part read so server profile settings cannot turn a cancelled or ordinary rebuild into a broken part. Validated `05621_s3_index_cancellation` with S3 and plan-based parallel replicas: the original binary detaches the part, while the patched binary passes all six scenarios. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116257&sha=40fd49ca3b81f67dc30875f3b21a05e86fa61c8a&name_0=PR Related: ClickHouse#116257
| } | ||
|
|
||
| /// Try to read a next portion of data. | ||
| checkIfNotCancelled(); |
There was a problem hiding this comment.
Each S3 read buffer that observes cancellation now writes a debug log record with a symbolized stack trace.
There is an edit in 02340 that hides this instead of fixing it, so I suppose that it is intended?
There was a problem hiding this comment.
nextImplcallscheckIfNotCancelled()beforeimpl->next(). Before, the check ran only inside the catch block, after a read error.- So cancellation is now thrown from inside
nextImpl.ReadBuffer::nextcatches it and callscancel(). That callstryLogCurrentExceptionwhich formats the stack trace.
One query with one column already produced several such records per run in CI.
| if (client_ptr->isClientForDisk()) | ||
| ProfileEvents::increment(ProfileEvents::DiskS3GetObject); | ||
| FailPointInjection::pauseFailPoint(FailPoints::s3_read_before_get_object); | ||
| fiu_do_on(FailPoints::s3_pause_merge_before_get_object, |
There was a problem hiding this comment.
A test-only failpoint in production code matches a hard-coded table name inside the query ID. It works only in Ordinary databases. Merge query IDs come from StorageID::getShortName(). In an Atomic database that is the table UUID, so the ".s3_pause_merge_before_get_object::" substring never matches.
Pause all reads before `GetObject` on the dedicated test server, then cancel the target merge and check its counters in `system.part_log`. This also exercises `Atomic` without matching a table name in S3 code. ## Changelog Category: Not for changelog Related: ClickHouse#116257
Use the same exception check for buffer diagnostics and S3 read errors. Retain the stack trace for independent I/O failures. Cover both paths in the S3 integration tests and restore the original `02340` log filter. ## Changelog Category: Improvement Cancelling a query or background merge no longer writes a debug stack trace for each affected read buffer. Related: ClickHouse#116257
Keep the cancellation failpoint before the serialization metadata read in `checkDataPart` and use upstream's read helper so local direct I/O stays enabled when requested. Related: ClickHouse#116257
MergeTreeprefetch and asynchronous marks loading could continue issuing S3 reads aftermax_execution_timewithtimeout_overflow_mode = 'throw', or afterKILL QUERY. Cancellation raised during metadata reads could also enter corruption recovery, reporting or detaching healthy parts or treating a valid backup as damaged.Cancellation is checked before scheduling work, when a task starts, after range refinement, and before subsequent S3 reads or retries. A worker that observes cancellation starts no further S3 request; an in-flight network call is allowed to complete.
The recovery changes also affect shared
MergeTreecode:CHECK TABLE, part and projection loading duringATTACH TABLE, index loading and rebuilding, and validation of restored parts. These paths preserve cancellation instead of classifying it as corruption. Mandatory transaction rollback, index publication, and synchronous outdated-part cleanup can finish after cancellation, including metadata reads needed for cleanup. Genuine storage failures retain their existing recovery behavior.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Stop outstanding
MergeTreeprefetch and asynchronous marks-loading work from issuing additional S3 reads after query timeout orKILL QUERYcancellation is observed. Preserve cancellation duringCHECK TABLE, part and index loading, and restore validation without reporting healthy parts or backups as damaged. Allow required rollback and cleanup to complete after cancellation.Workflow [PR]
Sync PR [sync-upstream/pr/116257]