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


##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergCommitter.java:
##########
@@ -138,8 +141,11 @@ 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);
+        restored

Review Comment:
   Instead of `restored` (BTW - isRestored is better), do we want to compare 
the restored checkpoint id with the one in the table? Like:
   ```
   long maxCommitted = SinkUtil.getMaxCommittedCheckpointId(...);
   if (maxCommitted > restoredCheckpointId) {   // absent => 
INITIAL_CHECKPOINT_ID
     maxCommitted = SinkUtil.INITIAL_CHECKPOINT_ID;
   }
   ```
   
   This would also fix if we try to restore the first checkpointid



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