You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The byte budget uses projected uncompressed Parquet bytes and is shared by the whole scan.
Why
A compacted Parquet file is one scan partition, so remote row-group reads were serialized even though the ranges are independent. Per-file concurrency alone could multiply memory and object-store requests when DataFusion runs several scan partitions.
Row-group producers fail to stop in a timely manner after downstream cancellation
Location: parquet.rs:517, parquet.rs:667
Issue: The producer first calls reserve() to reserve a channel, then waits for stream.next(); if the downstream drops the receiver due to LIMIT, an error, or query cancellation, the detached task waiting for I/O will not receive the cancellation notification and will continue to hold the ParquetReadPermit.
Trigger Conditions: Start forward_row_group_batches using a pending stream, then drop the receiver; if the task has not exited within 100 milliseconds, the test consistently fails.
Impact: Unnecessary object storage requests and decoding continue to run; more importantly, they continue to consume scan-shared row-group/byte permits, which may slow down DataFusion partitions that are still active.
The fix is very simple:
let next = tokio::select! {
_ = sender.closed() => return,
next = stream.next() => next,
};
It is recommended that the coordinator listen for row_group_tx.closed() while waiting for read_budget.acquire(...); after canceling the acquire future, the acquired semaphore permits will be automatically released. After applying the above fix, both my cancellation reproduction test and the original backpressure test passed.
The budget passing process can be simplified as follows:
Add an optional with_parquet_read_budget parameter to PaimonReadBuilder, which DataFusion injects before new_read().
Avoid first creating and then discarding a default budget for each partition, only to override it later via the exposed TableRead::with_parquet_read_budget method.
If shared resources such as caches and memory reservations are added later, they can be centralized into a single ReadContext to reduce the current field passing across a dozen or so readers.
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
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
Resource controls
read.parquet.row-group.parallelism(default:8; set to1to disable)read.parquet.row-group.max-inflight-bytes(default:256 mb)The byte budget uses projected uncompressed Parquet bytes and is shared by the whole scan.
Why
A compacted Parquet file is one scan partition, so remote row-group reads were serialized even though the ranges are independent. Per-file concurrency alone could multiply memory and object-store requests when DataFusion runs several scan partitions.
Benchmark
4.27s -> 1.07s5.156s -> 3.245s(1.59x)6s.Row count, batch count, total count, and result hashes matched.
Tests
2054 passed, 1 ignored29 passed