Beutlin commented on code in PR #18123:
URL: https://github.com/apache/iceberg/pull/18123#discussion_r4187254178
##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergCommitter.java:
##########
@@ -138,13 +141,24 @@ public void
commit(Collection<CommitRequest<IcebergCommittable>> commitRequests)
}
IcebergCommittable last =
commitRequestMap.lastEntry().getValue().getCommittable();
+ // A stateless start has no committed checkpoints; the table's mark would
drop every commit.
long maxCommittedCheckpointId =
- SinkUtil.getMaxCommittedCheckpointId(table, last.jobId(),
last.operatorId(), branch);
+ isRestored
+ ? SinkUtil.getMaxCommittedCheckpointId(table, last.jobId(),
last.operatorId(), branch)
+ : SinkUtil.INITIAL_CHECKPOINT_ID;
Review Comment:
Without this fix, every stateless restart with the same job ID drops commits
until the checkpoint ID exceeds the previous run's max, with no failure
involved. The case you describe also needs the first commit after the restart
to fail, which is a much narrower window. It also matches the V1
IcebergFilesCommitter behavior. So this PR fixes the common case and aligns
with V1.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]