danny0405 commented on code in PR #17607:
URL: https://github.com/apache/hudi/pull/17607#discussion_r2625625184


##########
hudi-common/src/main/java/org/apache/hudi/common/table/cdc/HoodieCDCExtractor.java:
##########
@@ -341,6 +341,20 @@ private Option<FileSlice> getDependentFileSliceForLogFile(
               .filter(logFile -> !logFile.equals(currentLogFileName))
               .map(logFile -> new StoragePath(partitionPath, logFile))
               .collect(Collectors.toList());
+          // get files list from unfinished compaction commit
+          List<StoragePath> filesToCompact = 
metaClient.getActiveTimeline().getInstants().stream().filter(
+                  i -> i.compareTo(instant) < 0 && !i.isCompleted() && 
i.getAction()
+                      .equals(HoodieActiveTimeline.COMPACTION_ACTION))

Review Comment:
   another way to fix is issue is to change how the write stat is generated: 
https://github.com/apache/hudi/blob/4ffad38863f03e753e9f9a6fc5bcfbc79a125ae5/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieAppendHandle.java#L208,
 instead of using `getLatestFileSlice`, we should use 
`getLatestMergedFileSliceBeforeOrOn`. But I'm not sure if that breaks other 
functions.



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