danny0405 commented on code in PR #13653:
URL: https://github.com/apache/hudi/pull/13653#discussion_r2249090670
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/savepoint/SavepointHelpers.java:
##########
@@ -66,4 +72,28 @@ public static void validateSavepointPresence(HoodieTable
table, String savepoint
throw new HoodieRollbackException("No savepoint for instantTime " +
savepointTime);
}
}
+
+ private static class SavepointInstantComparator implements
Comparator<HoodieInstant> {
+ private final boolean tableVersion8OrLater;
+ private final InstantComparator instantComparator;
+
+ public SavepointInstantComparator(boolean tableVersion8OrLater,
InstantComparator instantComparator) {
+ this.tableVersion8OrLater = tableVersion8OrLater;
+ this.instantComparator = instantComparator;
+ }
+
+ @Override
+ public int compare(HoodieInstant o1, HoodieInstant o2) {
+ if (tableVersion8OrLater) {
+ return instantComparator.completionTimeOrderedComparator().compare(o1,
o2);
+ } else {
+ // Do to special handling of compaction instants, we need to use
requested time based comparator for compaction instants but completion time
based comparator for others
+ if (o1.getAction().equals(HoodieTimeline.COMMIT_ACTION) ||
o2.getAction().equals(HoodieTimeline.COMMIT_ACTION)) {
Review Comment:
> The slice would just use t1 as the base and the log files would all be
present preventing data loss.
This is true, but the data loss comes from the deleted base file which
contains all the history dataset, not very related with file slicing though,
the table before V8 also has correct file slicing because the file name
contains the base instant time.
--
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]