You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/04/07 22:23:18 UTC

[GitHub] [hudi] nsivabalan commented on a diff in pull request #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

nsivabalan commented on code in PR #5052:
URL: https://github.com/apache/hudi/pull/5052#discussion_r845602394


##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/AbstractHoodieLogRecordReader.java:
##########
@@ -346,6 +349,19 @@ public synchronized void scan(Option<List<String>> keys) {
     }
   }
 
+  /**
+   * Check whether the current instants are valid
+   *
+   * @param instantTime
+   * @return
+   */
+  private boolean checkIfValidCommit(String instantTime) {
+    HoodieTimeline deltaCommitTimeline = this.hoodieTableMetaClient.getActiveTimeline().getDeltaCommitTimeline().filterCompletedInstants();
+    return deltaCommitTimeline.containsInstant(instantTime) ||
+        (deltaCommitTimeline.isBeforeTimelineStarts(instantTime) &&
+            this.hoodieTableMetaClient.getArchivedTimeline().getDeltaCommitTimeline().filterCompletedInstants().containsOrBeforeTimelineStarts(instantTime));

Review Comment:
   shouldn't we only do .contains() and not before with archived timeline. 
   



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