feat: expose io_buffer_size in CompactionOptions#7226
Open
aimanmalib wants to merge 1 commit into
Open
Conversation
Compaction builds its scan reader via prepare_reader, which previously only forwarded batch_size to the scanner. The scanner's io_buffer_size knob was never set during compaction, so users had no way to increase the I/O buffer. This matters because a single batch larger than the I/O buffer size causes the scanner to deadlock (documented in Scanner::io_buffer_size), and with backpressure warnings downgraded to debug this deadlock is silent at the default. Add an io_buffer_size field to CompactionOptions, plumb it through prepare_reader to scanner.io_buffer_size, and support the lance.compaction.io_buffer_size manifest config key. The Python binding (parse_compaction_options + CompactionOptions TypedDict) is updated to keep parameter names consistent across languages. Closes lance-format#4946
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
CompactionOptionsdid not exposeio_buffer_size, even though the scanner used during compaction supports it. Compaction builds its scan reader inprepare_reader, which only forwardedbatch_sizeto the scanner — theio_buffer_sizeknob was never set.This matters because a single batch larger than the I/O buffer size causes the scanner to deadlock (documented on
Scanner::io_buffer_size), and since the backpressure warning was downgraded todebug, this deadlock is now silent at the default. Users had no way to raise the buffer to avoid it during compaction.Resolves #4946.
Changes
io_buffer_size: Option<u64>toCompactionOptions(withDefault=None).lance.compaction.io_buffer_sizemanifest config key inapply_dataset_config.prepare_reader→scanner.io_buffer_size(...), mirroring the existingbatch_sizehandling.parse_compaction_optionsacceptsio_buffer_sizeCompactionOptionsTypedDict documents the fieldTesting
test_from_dataset_configto assert thelance.compaction.io_buffer_sizekey round-trips.test_compact_with_io_buffer_size(parametrized overLegacy/Stablefile versions) that runscompact_fileswith an explicitio_buffer_sizeand verifies the compaction succeeds and preserves all rows.cargo test -p lance --lib dataset::optimize::tests→ 76 passed, 0 failed.cargo clippy -p lance --lib --tests→ clean.cargo fmt --all -- --check→ clean.Notes
This is a non-breaking, additive change — the new field defaults to
None, preserving existing behavior when unset.