fix(encoding): reject mismatched miniblock buffer sizes - #9237
Open
lance-gatefixer[bot] wants to merge 1 commit into
Open
lance-gatefixer[bot] wants to merge 1 commit into
lance-gatefixer[bot] wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
This closes a real reader-side integrity gap: mini-block metadata must now cover exactly the declared data buffer before offsets are cached, so malformed pages fail with a contextual corrupt-file error instead of panicking in debug builds or scheduling invalid ranges in release builds. The validation is localized to the parsing boundary and preserves compatibility with the stable file formats.
This branch has not been deployed
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
Root cause
build_chunk_indexselected the prefix-sum storage width fromdata_buf_sizewhile accumulating independent sizes decoded from the metadata words. Their equality was enforced only by a debug assertion, so debug builds panicked and release builds could retain offsets beyond the buffer or choose an undersized prefix representation.The historical producer path in the reported run was removed by the column-stitching revert, but the reader-side integrity boundary remained unchecked.
Validation
cargo test -p lance-encoding test_rejects_mismatched_miniblock_data_size -- --nocapturecargo test -p lance-encoding --lib(1819 passed, 5 ignored)cargo test -p lance --lib index::vector::ivf::tests::test_create_index_nulls::case_5_ivf_hnsw_sq::index_version_1_IndexFileVersion__Legacy -- --exact --nocapturecargo fmt --all -- --checkcargo clippy --all --tests --benches -- -D warningsFixes #8947