Cancel write buffers in IcebergStorageSink on exception#96998
Merged
alexey-milovidov merged 1 commit intomasterfrom Feb 15, 2026
Merged
Cancel write buffers in IcebergStorageSink on exception#96998alexey-milovidov merged 1 commit intomasterfrom
alexey-milovidov merged 1 commit intomasterfrom
Conversation
When an error occurs during INSERT INTO an Iceberg table (e.g., from the AST fuzzer), `onFinish` is never called, so write buffers inside `MultipleFileWriter` are never finalized or canceled. When the sink is destroyed, `WriteBuffer::~WriteBuffer` triggers a "WriteBuffer is neither finalized nor canceled in destructor" assertion. Override `onException` in `IcebergStorageSink` to call `cancelBuffers`, ensuring all write buffers are properly canceled on error. Also add null checks in `MultipleFileWriter::cancel` since buffers may not exist if no data was consumed, or may already have been released after a successful `onFinish`. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96613&sha=89c8476a82ec00b6007e1def0608e4d049445a79&name_0=PR&name_1=Stress%20test%20%28arm_asan%29 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Member
Author
|
Looks okay. |
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.
Summary
onExceptioninIcebergStorageSinkto callcancelBuffers, ensuring write buffers are properly canceled when an error occurs during INSERT into an Iceberg tableMultipleFileWriter::cancelsince buffers may not exist if no data was consumed or may already have been released after successfulonFinishhttps://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96613&sha=89c8476a82ec00b6007e1def0608e4d049445a79&name_0=PR&name_1=Stress%20test%20%28arm_asan%29
#96613
Test plan
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
🤖 Generated with Claude Code