pvary commented on code in PR #18270:
URL: https://github.com/apache/iceberg/pull/18270#discussion_r4119447520
##########
flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergCommitter.java:
##########
@@ -138,8 +141,13 @@ public void
commit(Collection<CommitRequest<IcebergCommittable>> commitRequests)
}
IcebergCommittable last =
commitRequestMap.lastEntry().getValue().getCommittable();
+ // Only consult the table's commit history when the job was restored from
a checkpoint or
+ // savepoint. After a stateless restart the checkpoint counter starts
over, so reusing the
+ // previous run's max committed checkpoint id would silently discard every
new 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:
If we don't want to be silent, we might want to log warning on
`!alreadyCommitted.isEmpty()`
--
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]