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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##########
@@ -1360,7 +1361,10 @@ protected void compactIfNecessary(BaseHoodieWriteClient 
writeClient, String late
     // The compaction planner will manage to filter out the log files that 
finished with greater completion time.
     // see BaseHoodieCompactionPlanGenerator.generateCompactionPlan for more 
details.
     final String compactionInstantTime = 
dataMetaClient.reloadActiveTimeline().filterInflightsAndRequested()
-        
.findInstantsBeforeOrEquals(latestDeltacommitTime).firstInstant().map(HoodieInstant::getTimestamp)
+        .findInstantsBeforeOrEquals(latestDeltacommitTime).firstInstant()
+        // minus the pending instant time by 1 millisecond to avoid conflict 
in case when this pending instant was finally been committed
+        // as a delta_commit in MDT.
+        .map(instant -> 
HoodieInstantTimeGenerator.instantTimeMinusMillis(instant.getTimestamp(), 1L))

Review Comment:
   > Compaction with same %s time is already present in the timeline.).
   
   Not really, the earlist pending instant on DT may not have a committed 
delta_commit on MDT 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-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to