Skip to content

Conversation

@stevenzwu
Copy link
Contributor

@stevenzwu stevenzwu commented Nov 28, 2022

there are two scenarios why throttling is desirable for streaming read.

  1. large backlog. E.g., started the streaming job from earliest snapshot
  2. intentionally delayed consumption. E.g., if we have a stream join job reading from two Iceberg tables. First table has more real-time data and second table has typically delayed data (e.g. 24 hours). It would be great to delay the consumption for the second table by 24 hours for event time alignment. This way, we can reduce the join window in Flink state. With delayed consumption, it doesn't make sense to discovery all 24 hours of splits and hold them in enumerator memory.

@github-actions github-actions bot added the flink label Nov 28, 2022

@Override
public GetSplitResult getNext(@Nullable String hostname) {
public synchronized GetSplitResult getNext(@Nullable String hostname) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added synchronized because the new pendingSplitCount method can be called from I/O threads, while other methods are only called from the coordinator thread.

@stevenzwu stevenzwu requested a review from pvary November 28, 2022 20:08
@stevenzwu stevenzwu force-pushed the throttle-split-discovery branch 2 times, most recently from b1e2beb to 8f5ba15 Compare November 29, 2022 00:32
…of lagging behind or intentially delayed assumption.

This is to avoid eagerly discovering too many splits and tracking them in memory when the Flink job falling behind too much. It helps to keep memory footprint and enumerator checkpoint size in check.
@stevenzwu stevenzwu force-pushed the throttle-split-discovery branch from 8f5ba15 to 6b08dbc Compare November 29, 2022 01:07
@stevenzwu stevenzwu changed the title Flink: support split discovery throttling for streaming read in case … Flink: support split discovery throttling for streaming read Nov 29, 2022
@stevenzwu stevenzwu merged commit c21b5ed into apache:master Dec 5, 2022
@stevenzwu
Copy link
Contributor Author

Thanks @pvary and @hililiwei for the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants