Repository navigation
Keep S3 retries of cleanup when the query or merge is cancelled - #130818
Conversation
…once Fails on master: the merge aborts the upload of its other writer after the query is cancelled, and the S3 client does not retry the abort there.
Hold `ThreadStatus::QueryCancellationBlocker` in `WriteBufferFromS3::abortMultipartUpload`, the multipart abort of `copyS3File`, `DiskObjectStorageTransaction::undo` and `IMergeTreeDataPart::removeIfNeeded`.
|
Workflow [PR], commit [16d34d5] Summary: ✅
AI ReviewSummaryThe PR preserves configured S3 cleanup retries after query or merge cancellation by adding Missing context / blind spots
Final VerdictStatus: ✅ Approve. No code changes requested; runtime validation remains pending as noted above. |
Cleanup that must still reach S3 runs under `QueryCancellationBlocker` (#130818), so it keeps waiting.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Slowest function optimization changes (ThinLTO)Median per-function time ratio to the master baseline:
Compile time of recompiled translation units10 translation units recompiled, 44 s compile time in total, 10 of them have a recent master baseline. |
Related: #128185
Related: #127813
The S3 client does not retry in a thread whose query or merge is cancelled, and cleanup may run in such a thread. A failed
OPTIMIZE ... DRY RUN PARTScancels its query and then its merge, so the merge aborts the multipart uploads of its other writers with one attempt, and one transient error leaves an incomplete upload. A failed projection merge, a killedOPTIMIZEorINSERT, and the abort ofcopyS3Filebehave the same.Now
WriteBufferFromS3::abortMultipartUpload, the multipart abort ofcopyS3File,DiskObjectStorageTransaction::undoandIMergeTreeDataPart::removeIfNeededholdThreadStatus::QueryCancellationBlocker, asMergeTreeData::Transaction::rollbackdoes. Trade-off: during an S3 outage, this cleanup can delay a killed query or shutdown, as the cleanup of background merges already does.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix incomplete multipart uploads and orphaned blobs left on S3 when a cleanup request after a failed or cancelled query or merge failed once with a transient error: the cleanup now keeps its S3 retries after the cancellation.
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/130818]
Version info
26.11.1.2107-master(included in26.11and later)