Flink: Allow independent parallelism bounds for DynamicIcebergSink committer - #17879
Flink: Allow independent parallelism bounds for DynamicIcebergSink committer#17879bujjibabukatta wants to merge 2 commits into
Conversation
|
Hi @sbaia could you please review code and merge the pr? |
|
Hi @huaxingao can you please review and merge pull request ? |
|
I reviewed the generated SinkV2 topology, and I don't think the current implementation configures the actual committer operator. The new values are applied to the transformation returned by https://github.com/apache/iceberg/pull/17879/files Flink creates the actual Because that generated transformation still has default parallelism/max parallelism, Flink assigns it the values from the sink transformation, not from the preceding pre-commit transformation: For example, with: .writeParallelism(8)
.committerParallelism(1)
.committerMaxParallelism(1)this patch sets the pre-commit aggregator to parallelism 1, while the generated This is also a correctness concern. Setting only Could you please add a JobGraph-level regression test that:
I expect this test to fail with the current implementation. If so, we still need either a Flink SinkV2 API/translator capability for the generated committer, or a larger Iceberg-side topology redesign. Also, the PR currently changes only the Flink 2.1 module and adds no tests for the new options. |
Summary
Adds
committerParallelism(int)andcommitterMaxParallelism(int)toDynamicIcebergSink.Builder, letting the pre-commit/committer operator bescaled independently of
writeParallelism(int). Both are optional; whenunset, the committer continues to inherit its parallelism from the upstream
writer topology (unchanged default behavior).
Closes #17863
Root Cause
DynamicIcebergSinkimplements Flink'sSupportsPreCommitTopology, andbuilds its own pre-commit/committer operator via
.keyBy(...).transform(...)inaddPreCommitTopology(). That.transform(...)call never set an explicit parallelism, so the operatorsilently inherited whatever parallelism the upstream writer chain had.
Since dynamic committers process checkpoint-batched, per-table metadata
rather than per-record data, their scaling needs differ from the writer's.
With no independent bound, autoscalers that estimate demand from edge rates
can scale the committer in lockstep with the writer even though its actual
load is far lower, and the only workarounds (
job.autoscaler.vertex.exclude.ids,a global autoscaler max, or changing job-wide max parallelism) are either
awkward or affect unrelated vertices/keyed-state compatibility.
Fix
FlinkWriteOptions.COMMITTER_PARALLELISMandCOMMITTER_MAX_PARALLELISMconfig options.FlinkWriteConf.DynamicIcebergSink.Builder#committerParallelism(int)and#committerMaxParallelism(int), writing into the samewriteOptionsmapas the existing
writeParallelism(int).addPreCommitTopology(), capture the.transform(...)result andconditionally call
.setParallelism(...)/.setMaxParallelism(...)onit when the new options are set, leaving the operator's
.uid(...)unchanged so existing checkpoint state remains restorable.
No Flink SinkV2 framework changes were needed —
addPreCommitTopology()isimplemented entirely with the standard, public
DataStreamAPI, whichalready exposes
setParallelism/setMaxParallelismon the returnedoperator.