fix(index): serialize FTS position prewarm to avoid an IO-scheduler deadlock#7623
Open
BubbleCal wants to merge 1 commit into
Open
fix(index): serialize FTS position prewarm to avoid an IO-scheduler deadlock#7623BubbleCal wants to merge 1 commit into
BubbleCal wants to merge 1 commit into
Conversation
…backpressure wedge Position streams are dominated by a few huge hot-token rows, so position-bearing prewarm chunks routinely span hundreds of MBs. Two or more such read_ranges in flight on the store's shared ScanScheduler can exhaust its backpressure window while every request still has undelivered pages (later pages of a request never pass the min_in_flight priority bypass), deadlocking the prewarm. A single request in flight always delivers in order and recycles the window, so run position prewarm chunks serially. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Problem
prewarm_index(..., with_position=True)deadlocks on position-bearing inverted indexes: all tokio workers park and the prewarm never completes (reproduced on a 50M-doc index; >14 min with zero progress before this fix, vs ~19 min to fully prewarm 162G after it).Position streams are dominated by a few huge hot-token rows, so prewarm chunks sized for the 128MB average routinely span hundreds of MBs to GBs. Two or more such
read_ranges in flight on the store's sharedScanSchedulercan exhaust its byte backpressure window while every request still has undelivered pages: a request's later pages never pass themin_in_flightpriority bypass, so nothing can complete and nothing frees the window.Fix
A single request in flight always delivers in order and recycles the window, so position prewarm now runs its chunks serially. Position-less prewarm keeps the concurrent path (its chunks are bounded by the 128MB target and never wedge).
The scheduler-side wedge (concurrent large
read_ranges on oneScanScheduler) is a separate latent lance-io issue; this change removes the only known trigger.Verification
cargo test -p lance-index(inverted suite),cargo clippy -- -D warnings,cargo fmt --checkall clean.🤖 Generated with Claude Code