fix: dispatch concurrent blob range reads#7861
Merged
Merged
Conversation
Contributor
📝 WalkthroughWalkthroughChangesBlob read concurrency
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant BlobSource
participant TokioTask
participant FileScheduler
BlobSource->>TokioTask: Spawn blob batch fulfillment
TokioTask->>FileScheduler: Dispatch current batch
BlobSource->>TokioTask: Dispatch subsequent batch
FileScheduler-->>TokioTask: Apply scheduling and backpressure
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Xuanwo
marked this pull request as ready for review
July 20, 2026 15:40
BubbleCal
approved these changes
Jul 20, 2026
wjones127
pushed a commit
that referenced
this pull request
Jul 21, 2026
Concurrent BlobFile range reads against the same physical source were serialized between opportunistic batches because BlobSource waited for each batch to finish I/O before draining requests that arrived while it was in flight. This made caller concurrency scale poorly even though the Python binding releases the GIL and the existing scheduler can execute the reads concurrently. Dispatch each drained batch without waiting for earlier batches to finish, while leaving FileScheduler responsible for I/O concurrency and byte backpressure. Deterministic same-source and multi-source gated tests cover the batching boundary and existing order and cursor behavior. ### Real S3 impact Measured on Amazon S3 in us-east-2 with 100 KiB range reads at concurrency 64: | Configuration | Before | After | Throughput gain | p50 before | p50 after | p50 reduction | | --- | ---: | ---: | ---: | ---: | ---: | ---: | | Dedicated / same source | 876 reads/s | 2,531 reads/s | 2.89x | 64.7 ms | 23.9 ms | 63.1% | | Dedicated / multiple sources | 1,169 reads/s | 2,505 reads/s | 2.14x | 53.5 ms | 24.0 ms | 55.1% | | Packed / same source | 1,004 reads/s | 2,463 reads/s | 2.45x | 59.4 ms | 24.6 ms | 58.5% | | Packed / multiple sources | 1,076 reads/s | 2,502 reads/s | 2.33x | 60.0 ms | 24.3 ms | 59.4% | After the fix, Lance reached 2,463–2,531 reads/s with 23.9–24.6 ms p50 latency, matching direct S3 ranged reads at 2,320–2,487 reads/s and 23.8–25.1 ms p50. Every sample remained one GET with zero HEAD requests, and physical bytes matched logical bytes. The benchmark harness used to establish these results is intentionally not included in this pull request. (cherry picked from commit 20992ae)
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.
Concurrent BlobFile range reads against the same physical source were serialized between opportunistic batches because BlobSource waited for each batch to finish I/O before draining requests that arrived while it was in flight. This made caller concurrency scale poorly even though the Python binding releases the GIL and the existing scheduler can execute the reads concurrently.
Dispatch each drained batch without waiting for earlier batches to finish, while leaving FileScheduler responsible for I/O concurrency and byte backpressure. Deterministic same-source and multi-source gated tests cover the batching boundary and existing order and cursor behavior.
Real S3 impact
Measured on Amazon S3 in us-east-2 with 100 KiB range reads at concurrency 64:
After the fix, Lance reached 2,463–2,531 reads/s with 23.9–24.6 ms p50 latency, matching direct S3 ranged reads at 2,320–2,487 reads/s and 23.8–25.1 ms p50. Every sample remained one GET with zero HEAD requests, and physical bytes matched logical bytes.
The benchmark harness used to establish these results is intentionally not included in this pull request.