Repository navigation
Conversation
Add `input_format_parquet_prefetch_bandwidth_hide_seconds`. When it is greater than zero, the scheduler stops admitting further `ColumnDataPrefetch` tasks once the compressed bytes already in flight exceed that many seconds of the measured read throughput. Beyond that point the storage link is already fed, so extra compressed buffering only costs memory without improving throughput. The `Prefetcher` now counts the bytes of completed read tasks and exposes `averageThroughputBytesPerSec` (bytes since `init` divided by elapsed time). The estimate is reported as unknown (0) until at least 1 MiB has been read and 50 ms have elapsed, and an unknown estimate does not throttle. The `ColumnDataPrefetch` stage memory usage is the in-flight compressed bytes, so `ReadManager::scheduleTasksIfNeeded` compares it, plus the bytes already queued in the current scheduling pass, against `throughput * hide_seconds`. The existing privileged-task escape still applies, and with nothing in flight the check always passes, so the back-pressure cannot deadlock the reader. The setting defaults to 0, which keeps the previous behavior: compressed prefetch is bounded only by its memory budget. Co-authored-by: Cursor <cursoragent@cursor.com>
…ssure Add the `ParquetPrefetchBackPressureStalls` profile event, incremented each time `input_format_parquet_prefetch_bandwidth_hide_seconds` holds back a prefetch task that the memory and thread limits would have allowed. It makes the back-pressure observable. Add `05818_parquet_prefetch_bandwidth_back_pressure`: a file with 100 row groups is read with the back-pressure disabled and with a tiny target. Both reads return the same result without hanging, and only the second one records stalls. A small memory watermark and a slow consumer make the scheduler run again after the throughput estimate is available. Co-authored-by: Cursor <cursoragent@cursor.com>
13 tasks
This branch has not been deployed
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.
Part of #2181 (Parquet v3 reader), only the part that is missing from
antalya-26.8. The branch already has theColumnDataPrefetchstage, which lets many row groups download while a few are decoded, and the stage memory fractionsinput_format_parquet_prefetch_memory_fractionandinput_format_parquet_decode_thread_fraction. What it lacks is a back-pressure based on the read throughput.This adds
input_format_parquet_prefetch_bandwidth_hide_seconds. When it is greater than zero, the scheduler stops admitting moreColumnDataPrefetchtasks once the compressed bytes already in flight exceed that many seconds of the measured read throughput. Past that point the storage link is already busy, so more compressed buffering only costs memory. The default is 0, which keeps the current behavior, where compressed prefetch is bounded only by its memory budget.How it behaves:
Prefetchercounts the bytes of completed reads, and the throughput is the average sinceinit. It is treated as unknown until 1 MiB has been read and 50 ms have passed, and unknown means no throttling.ParquetPrefetchBackPressureStallscounts how often the back-pressure held back a task that the other limits would have allowed.Limitations: the estimate is an average since
init, so throttling lowers the estimate and can tighten itself, which is why the setting is opt-in. The test checks that results are unchanged, that nothing hangs and that the throttle engages. It does not measure the memory or latency benefit on a remote storage with high latency.Related: #2181
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Added the setting
input_format_parquet_prefetch_bandwidth_hide_secondsfor the Parquet v3 reader. When it is greater than zero, prefetching of compressed data stops once the in-flight compressed bytes exceed that many seconds of the measured read throughput. It is disabled by default. Added the profile eventParquetPrefetchBackPressureStalls.Documentation entry for user-facing changes
The setting is documented in its declaration (
input_format_parquet_prefetch_bandwidth_hide_seconds), and the profile event in its description inProfileEvents.cpp.CI/CD Options
Exclude tests:
Regression jobs to run: