mxm commented on code in PR #18123:
URL: https://github.com/apache/iceberg/pull/18123#discussion_r4184568908


##########
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:
   I wonder, is the new behavior correct? This will reset the checkpoint id to 
1 on restart. Let's say we try to commit and fail, we then restore and get the 
max committed checkpoint id, which will be higher than 1, causing us to drop 
the pending commit.



-- 
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]

Reply via email to