[Flink] Select bounded-source split assignment by estimated size - #39874
Open
pkuzmickas wants to merge 1 commit into
Open
[Flink] Select bounded-source split assignment by estimated size#39874pkuzmickas wants to merge 1 commit into
pkuzmickas wants to merge 1 commit into
Conversation
pkuzmickas
force-pushed
the
pkuzmickas/flink-source-assignment-by-size
branch
from
August 24, 2026 10:47
f362fb0 to
f110427
Compare
Author
|
Run Java PreCommit |
pkuzmickas
marked this pull request as ready for review
August 24, 2026 13:15
Contributor
|
Assigning reviewers: R: @shunping for label website. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
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.
Summary
Add an opt-in, size-based split-assignment strategy for bounded sources in the Flink DataStream runner.
The default remains lazy pull-based assignment. When users configure a positive threshold, the runner assigns sources estimated below that size per reader statically and keeps larger sources lazy. A negative value forces static assignment.
Fixes #39873.
Why
Moving production workloads from the Flink 1 DataSet runner to the Flink 2 DataStream runner caused large performance regressions for sources that emit inexpensive descriptors for expensive downstream work.
The DataStream runner currently sends all bounded sources to the lazy enumerator. That enumerator gives the next split to whichever reader requests it. This balances sources whose splits contain expensive I/O, but fast-starting readers can claim most descriptors before their peers start. A pointwise downstream edge then preserves the skew during the expensive work.
Static assignment fixes descriptor sources but can slow direct file readers, where dynamic work sharing compensates for different file sizes. The option therefore remains disabled by default and lets each pipeline choose a threshold.
Performance
These anonymized production measurements used matching input partitions and isolated outputs.
The measured descriptor and file-reader examples were approximately 4 GiB and 8 GiB per reader, respectively. This supports a threshold near 6 GiB for those pipelines, but estimated bytes are only a proxy for split cost; Beam does not select a global threshold.
Configuration
lazySourceSplitAssignmentMinSizeMbPerReader(Python:lazy_source_split_assignment_min_size_mb_per_reader) controls bounded-source assignment:0(default): always use the existing lazy assignment.Implementation
Compatibility
Existing pipelines keep lazy bounded-source assignment because the option defaults to
0. Existing checkpoints retain their previous assignment behavior. Estimation failures continue to fail the job, matching the current runner.Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on making the review process smoother.