the-other-tim-brown commented on code in PR #13653:
URL: https://github.com/apache/hudi/pull/13653#discussion_r2249084661


##########
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:
   Isn't the file slice computed at runtime for v8? The slice would just use t1 
as the base and the log files would all be present preventing data loss.
   
   Even if the above is accurate, if we want to just keep it consistent between 
versions for ease of operation, I am fine with that as well.



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