Skip to content

Flink: Parallelize writer flush in DynamicWriter.prepareCommit#16015

Open
lrsb wants to merge 1 commit intoapache:mainfrom
lrsb:flink-parallelize-writer-flush
Open

Flink: Parallelize writer flush in DynamicWriter.prepareCommit#16015
lrsb wants to merge 1 commit intoapache:mainfrom
lrsb:flink-parallelize-writer-flush

Conversation

@lrsb
Copy link
Copy Markdown

@lrsb lrsb commented Apr 17, 2026

Fixes #16014

DynamicWriter.prepareCommit() flushed each TaskWriter sequentially on the Flink task thread. When many schemas / write targets are active at checkpoint time this makes checkpointing latency dominated by the sum of all per-writer flush times, and the task thread is blocked on IO throughout.

Submit each TaskWriter.complete() call to a per-subtask fixed-size thread pool and wait for all futures to join before collecting results. Metrics recording stays sequential after the join because DynamicWriterMetrics is not thread-safe.

DynamicWriter.prepareCommit() flushed each TaskWriter sequentially on
the Flink task thread. When many schemas / write targets are active at
checkpoint time this makes checkpointing latency dominated by the
sum of all per-writer flush times, and the task thread is blocked on
IO throughout.

Submit each TaskWriter.complete() call to a per-subtask fixed-size
thread pool and wait for all futures to join before collecting results.
Metrics recording stays sequential after the join because
DynamicWriterMetrics is not thread-safe.
@github-actions github-actions bot added the flink label Apr 17, 2026
@lrsb lrsb marked this pull request as ready for review April 17, 2026 15:36
@pvary
Copy link
Copy Markdown
Contributor

pvary commented Apr 17, 2026

@lrsb: We usually create the PR against the newest version of Flink, and when that is reviewed and merged then backport the change to the older Flink version.
This saves time for the contributor and the reviewer as well if multiple iterations are needed.

@lrsb
Copy link
Copy Markdown
Author

lrsb commented Apr 17, 2026

Will fix, thanks for bringing this up!

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.

Parallelize writer flush in DynamicWriter.prepareCommit

2 participants