yihua commented on code in PR #7561:
URL: https://github.com/apache/hudi/pull/7561#discussion_r1206050514


##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/TimelineUtils.java:
##########
@@ -210,11 +210,30 @@ public static HoodieDefaultTimeline 
getTimeline(HoodieTableMetaClient metaClient
     return activeTimeline;
   }
 
+  /**
+   * Returns a Hudi timeline with commits after the given instant time 
(exclusive).
+   *
+   * @param metaClient                {@link HoodieTableMetaClient} instance.
+   * @param exclusiveStartInstantTime Start instant time (exclusive).
+   * @return Hudi timeline.
+   */
+  public static HoodieTimeline getCommitsTimelineAfter(
+      HoodieTableMetaClient metaClient, String exclusiveStartInstantTime) {
+    HoodieActiveTimeline activeTimeline = metaClient.getActiveTimeline();
+    HoodieDefaultTimeline timeline =
+        activeTimeline.isBeforeTimelineStarts(exclusiveStartInstantTime)

Review Comment:
   @BruceKellan You bring up a good point.  So you are talking about the 
following case where the timeline is like:
   ```
   ts3.rollback, ts50.commit, ts51.commit, ts52.commit, ...
   ```
   and `ts49.commit` and `ts48.commit` are archived.
   
   If we pass in `ts47` as the `exclusiveStartInstantTime` at this point, 
`activeTimeline.isBeforeTimelineStarts(exclusiveStartInstantTime)` returns 
`false`.  However, the active timeline misses `ts48.commit` and `ts49.commit` 
which are required for meta sync.  This is a problem if `ts48.commit` or 
`ts49.commit` has partition changes.
   
   I'll put up a fix on that.  Thanks for catching 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