fix(fts): chunk posting reads during segment merge - #8668
Merged
Conversation
BubbleCal
force-pushed
the
yang/fix-fts-merge-offset-overflow
branch
2 times, most recently
from
August 21, 2026 04:57
bbb4d1a to
58c1573
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Avoid materializing an entire inverted-index partition in one Arrow batch during segment merge. Bound reads by token count, estimated bytes, and List child offsets while preserving V1 and V3 position layouts.
BubbleCal
force-pushed
the
yang/fix-fts-merge-offset-overflow
branch
from
August 21, 2026 05:41
58c1573 to
83265e6
Compare
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The current-format planner retains exact metadata-based batching and buffer sharing, while compressed V1 LegacyPerDoc reads now use the conservative one-token boundary required by their nested-list layout. The focused coverage verifies both paths.
Xuanwo
approved these changes
Aug 21, 2026
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.
What is the bug?
FTS segment merge materializes every posting row in an
invert.lancepartition as one ArrowRecordBatch. Large partitions can exceed thei32child-offset capacity of the posting, impact, or positionListcolumns while Arrow concatenates pages, causing anoffset overflowpanic after indexing has otherwise completed.What issues or incorrect behavior does the bug cause?
Large segmented FTS rebuilds can finish tokenization but fail while finalizing intermediate segments. Because the final index segment is never committed, callers cannot complete the rebuild and automated maintenance can encounter the same deterministic failure again.
How does this PR fix the problem?
InvertedPartition::into_builderwith sequential token-range chunksList<i32>child count derived from posting metadataThe pre-compression row-based legacy layout keeps its existing row-count fallback and is outside this incident scope.
Token ordering, posting contents, position data, impact data, public APIs, and the on-disk format remain unchanged.
Tests
cargo test -p lance-index test_into_builder_chunks_postings_by_list_children -- --nocapturecargo test -p lance-index test_chunk_posting_mode_controls_buffer_sharing -- --nocapturecargo test -p lance-index test_prewarm_streams_in_chunks -- --nocapturecargo test -p lance-index test_merge_segments_ -- --nocapturecargo check -p lance-index --testscargo fmt --all -- --checkgit diff --check main...HEADcargo clippy -p lance-index --tests -- -D warnings -A clippy::single-range-in-vec-init -A clippy::implicit-cloneStrict local Clippy on Rust 1.97 currently reports pre-existing
single-range-in-vec-initandimplicit-clonefindings in untouched files; allowing only those two lints makes the changed package pass cleanly.