fix: avoid empty range reads for zero-length blobs#6168
fix: avoid empty range reads for zero-length blobs#6168Xuanwo merged 2 commits intolance-format:mainfrom
Conversation
PR ReviewClean, well-motivated bugfix. The core changes are correct:
One minor note: In Tests look good — the LGTM |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This PR moves a few unrelated clippy cleanups out of #6168 so the blob empty-range fix can stay focused on the regression it addresses. The changes here are all mechanical simplifications with no intended behavior change.
65b6460 to
de96032
Compare
Short-circuit empty blob reads and keep blob cursors relative to the blob size.
de96032 to
ea2de4b
Compare
Blob reads should return empty bytes when the logical blob is empty or the cursor is already at EOF. Today
BlobFile::read/read_up_tocan still issue aget_range(start..end)request withstart == end, which is tolerated by local readers but rejected by cloud object stores.This showed up while investigating
random_blobfailures on the original-scalelaion10m-fulldataset, where legacy blob reads on S3 failed with errors likeRange started at 1 and ended at 1. The fix short-circuits empty reads and restores the cursor to blob-relative semantics afterread(), and adds regression coverage for both the empty-range case and packed-blob cursor behavior.