You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "danny0405 (via GitHub)" <gi...@apache.org> on 2023/04/13 06:24:36 UTC

[GitHub] [hudi] danny0405 commented on a diff in pull request #8443: [HUDI-6068] Improve logic of getOldestInstantToRetainForClustering wh…

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


##########
hudi-common/src/main/java/org/apache/hudi/common/util/ClusteringUtils.java:
##########
@@ -243,23 +242,34 @@ public static Option<HoodieInstant> getOldestInstantToRetainForClustering(
     HoodieTimeline replaceTimeline = activeTimeline.getTimelineOfActions(CollectionUtils.createSet(HoodieTimeline.REPLACE_COMMIT_ACTION));
     if (!replaceTimeline.empty()) {
       Option<HoodieInstant> cleanInstantOpt =
-          activeTimeline.getCleanerTimeline().filter(instant -> !instant.isCompleted()).firstInstant();
+          activeTimeline.getCleanerTimeline().filterCompletedInstants().lastInstant();

Review Comment:
   Nice catch, using completed clean instants is more reliable.



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org