Repository navigation
Propagate decompressor errors when reading compressed blocks - #46
Merged
Merged
Conversation
`readCompressedBlock` left the `filtering_istream` with its default exception mask, so a decompressor exception only set `badbit`, which `IStreamBufferCopyIn::read` treats as the end of data. When the decoded records fill the input buffer exactly, the error of a truncated or corrupted block happened during the drain in `hasMore` and was discarded, and the block was read successfully. Related: ClickHouse/ClickHouse#127774 Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexey-milovidov
added a commit
to ClickHouse/ClickHouse
that referenced
this pull request
Oct 26, 2026
Update the `avro` submodule, which now propagates decompressor errors instead of treating them as the end of data. Previously, a truncated `bzip2` or `xz` block was read successfully when the decoded records filled the input buffer exactly. Address review: #127774 Related: ClickHouse/avro#46 Co-Authored-By: Claude Opus 5.5 <[email protected]>
With `badbit` in the exception mask of the decompressing stream, its read rethrows the error of the decompressor, e.g. `boost::iostreams::zlib_error`, which is not an `avro::Exception`, so ClickHouse reported a corrupted `deflate` block as `STD_EXCEPTION` instead of `AVRO_EXCEPTION`. Wrap it in `IStreamBufferCopyIn`. Related: ClickHouse/ClickHouse#127774 Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexey-milovidov
added a commit
to ClickHouse/ClickHouse
that referenced
this pull request
Oct 27, 2026
Update the `avro` submodule: after the previous change, a decompressor error of a corrupted `deflate` block propagated as `boost::iostreams::zlib_error` and was reported as `STD_EXCEPTION`, which broke `04947_avro_count_from_files_forward_progress`. The decompressor errors are now wrapped in `avro::Exception`. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=127774&sha=latest&name_0=PR&name_1=Stateless%20tests%20(amd_debug%2C%20parallel) Related: ClickHouse/avro#46 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
readCompressedBlockleft thefiltering_istreamwith its default exception mask, so a decompressor exception only setbadbit, whichIStreamBufferCopyIn::readtreats as the end of data. When the decoded records fill the input buffer exactly, the error of a truncated or corrupted block happened during the drain inhasMoreand was discarded, so the block was read successfully. This affects thedeflate,zstd,bzip2andxzcodecs.Now the exception mask includes
badbit, so the original decompressor exception propagates.Related: ClickHouse/ClickHouse#127774
Related: #45
🤖 Generated with Claude Code