bvaradar commented on code in PR #7997:
URL: https://github.com/apache/hudi/pull/7997#discussion_r1113911602


##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieFileGroup.java:
##########
@@ -122,7 +129,24 @@ public HoodieFileGroupId getFileGroupId() {
    * some log files, that are based off a commit or delta commit.
    */
   private boolean isFileSliceCommitted(FileSlice slice) {
-    if (!compareTimestamps(slice.getBaseInstantTime(), LESSER_THAN_OR_EQUALS, 
lastInstant.get().getTimestamp())) {
+    if (compareTimestamps(slice.getBaseInstantTime(), GREATER_THAN, 
lastInstant.get().getTimestamp())) {
+      return false;
+    }
+
+    if (!slice.getBaseFile().isPresent() && 
timeline.isBeforeTimelineStarts(slice.getBaseInstantTime())) {

Review Comment:
   @voonhous : Not sure I am following this. when rollback happens, command 
block gets added to skip rollbacked log blocks. 
   
   



##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieFileGroup.java:
##########
@@ -148,7 +172,10 @@ public Option<FileSlice> 
getLatestFileSlicesIncludingInflight() {
    */
   public Stream<FileSlice> getAllFileSlices() {
     if (!timeline.empty()) {
-      return fileSlices.values().stream().filter(this::isFileSliceCommitted);
+      List<String> instantsToRollback = getInstantsToRollbackFromTimeline();
+      return fileSlices.values().stream()
+          .filter(this::isFileSliceCommitted)
+          .filter(s -> !instantsToRollback.contains(s.getBaseInstantTime()));

Review Comment:
   HoodieFileGroup is a core class and getAllFileSlices() is extensively used.  
this is not the right place to be reading rollback metadata.  This will slow 
down almost all timeline operations. 



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