Repository navigation
An empty frame is an error, as it was before decode_frame - #200
Merged
Merged
Conversation
decode_frame returned an empty chunk for an empty input. zstd's decode_all,
which it replaced, refuses one ("incomplete frame"), and an index record that
says a chunk is zero bytes long is corrupt: in the query path it would now show
as an empty chunk where it used to be an error.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
A correction to #196 (released in 0.35.2).
decode_framespecial-cased an empty input and returned an empty chunk. My description of that change said it was "asdecode_alldid". It was not:zstd::stream::decode_all(&[])returnsErr(incomplete frame), which I have now checked directly. I wrote that without testing it, and a test of my own helper found it.The effect was small but real. An index record that says a chunk is zero bytes long is corrupt. Before #196 that was an error in every read path. After it,
store.rsstill caught it (it compares the length with the index), butquery'sread_chunkwould return an empty chunk silently.decode_framenow refuses an empty input again. Tests: the existing assertion is inverted, and a zero-length chunk record is followed throughread_frameanddecode_frameto the error.🤖 Generated with Claude Code