danny0405 commented on code in PR #17943:
URL: https://github.com/apache/hudi/pull/17943#discussion_r2791385703
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/clean/CleanPlanner.java:
##########
@@ -184,14 +184,15 @@ private boolean canCleanBeSkipped() {
}
// Check whether there are any other commits apart from deltacommits
between last compaction and last clean.
- int nonDeltaCommitsBetweenCompactionAndClean = activeTimeline
- .findInstantsAfter(lastCompactionInstant.get().requestedTime())
- .findInstantsBefore(lastCleanInstant.get().requestedTime())
+ int numNonDeltaCommitsAfterLastClean = activeTimeline
+ .getWriteTimeline()
+ .filterCompletedInstants()
+ .findInstantsAfter(lastCleanInstant.get().requestedTime())
.filter(instant ->
!instant.getAction().equals(HoodieTimeline.DELTA_COMMIT_ACTION))
.countInstants();
return
InstantComparison.compareTimestamps(lastCompactionInstant.get().getCompletionTime(),
Review Comment:
two corner cases:
assumes the last clean request time as t10;
1. a replace commit that starts at t8 and completes at t12;
2. a compaction starts at t11 and not complets yet
Both of these two should trigger cleaning I think.
--
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]