danny0405 commented on code in PR #18018:
URL: https://github.com/apache/hudi/pull/18018#discussion_r2749058648


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/partitioner/index/RecordLevelIndexBackend.java:
##########
@@ -106,9 +106,9 @@ public void onCheckpoint(long checkpointId) {
   }
 
   @Override
-  public void onCheckpointComplete(Correspondent correspondent) {
+  public void onCheckpointComplete(Correspondent correspondent, long 
currentCheckpointId) {
     Map<Long, String> inflightInstants = 
correspondent.requestInflightInstants();
-    
recordIndexCache.clean(inflightInstants.keySet().stream().min(Long::compareTo).orElse(Long.MAX_VALUE));
+    
recordIndexCache.markCleanable(inflightInstants.keySet().stream().min(Long::compareTo).orElse(currentCheckpointId));

Review Comment:
   the `#onCheckpointComplete` got a ack msg for the latest successful 
checkpoint right, combined with the mappings info from the coordinator, we can 
infer which checkpoints needs to be retained, here the current checkpoint 
should be kept because it is not on coordinator and the acked checkpoint id is 
smaller than it.



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

Reply via email to