mxm commented on code in PR #17901:
URL: https://github.com/apache/iceberg/pull/17901#discussion_r4564761685
##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergCommitter.java:
##########
@@ -324,8 +324,32 @@ private void commitOperation(
operation.set(SinkUtil.OPERATOR_ID, operatorId);
operation.toBranch(branch);
+ // Check again inside the commit, because another commit for this
checkpoint can land after the
+ // up-front getMaxCommittedCheckpointId() read. Like that read, this only
applies after a
+ // restore: a stateless start may reuse the job ID with checkpoint IDs
starting from 1 again.
+ if (isRestored) {
+ operation.validateWith(
+ new SinkUtil.MaxCommittedCheckpointIdValidator(
+ checkpointId,
+ snapshotSummary ->
+ SinkUtil.writtenBySameJob(snapshotSummary, newFlinkJobId,
operatorId)));
+ }
+
Review Comment:
I don't think we need the `isRestored` anymore with the changes in #18807.
--
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]