Conversation
Guosmilesmile
left a comment
Contributor
There was a problem hiding this comment.
Thanks for your PR! Could we fix the CI errors first?
| public class SinkUtil { | ||
|
|
||
| private static final long INITIAL_CHECKPOINT_ID = -1L; | ||
| public static final long INITIAL_CHECKPOINT_ID = -1L; |
IcebergCommitter#commit unconditionally looked up flink.max-committed-checkpoint-id for the incoming committable's jobId-operatorId pair. On a stateless restart the checkpoint counter starts over from 1 while the table still carries the previous run's higher watermark for that same pair, so every new committable was marked as already committed and silently dropped without producing a snapshot. Gate the lookup on whether the committer actually restored state, mirroring the isRestored() check already used by the legacy IcebergFilesCommitter. On a stateless start there is no restored Flink state and therefore no possibility of a redelivered committable, so every committable can be committed unconditionally. This change was drafted with AI assistance and verified by running the existing and new IcebergCommitter tests, plus a manual regression check confirming the new tests fail without the fix.
Restrict SinkUtil.INITIAL_CHECKPOINT_ID back to package-private visibility, since it is only used within org.apache.iceberg.flink.sink. Rework testCommitTxnAfterStatelessRestart to exercise the real IcebergSink/CommitterOperatorFactory pipeline via test harnesses instead of constructing IcebergCommitter directly with a manually supplied `restored` argument, so the test verifies that IcebergSink#createCommitter derives `restored` correctly from the operator's actual (non-)restored state.
Beutlin
force-pushed
the
flink-stateless-restart-commit-drop
branch
from
September 16, 2026 09:08
6a58e12 to
069515a
Compare
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.
IcebergCommitter#commit unconditionally looked up
flink.max-committed-checkpoint-id for the incoming committable's jobId-operatorId pair. On a stateless restart the checkpoint counter starts over from 1 while the table still carries the previous run's higher watermark for that same pair, so every new committable was marked as already committed and silently dropped without producing a snapshot.
Gate the lookup on whether the committer actually restored state, mirroring the isRestored() check already used by the legacy IcebergFilesCommitter. On a stateless start there is no restored Flink state and therefore no possibility of a redelivered committable, so every committable can be committed unconditionally.
This change was drafted with AI assistance and verified by running the existing and new IcebergCommitter tests, plus a manual regression check confirming the new tests fail without the fix.