fhan688 commented on code in PR #19041:
URL: https://github.com/apache/hudi/pull/19041#discussion_r3620160831


##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/io/TestHoodieTimelineArchiver.java:
##########
@@ -502,9 +503,8 @@ private HoodieInstant commitWithMdt(String instantTime, 
Map<String, List<String>
       commitMeta = generateCommitMetadata(instantTime, partToFileIds);
       metadataWriter.performTableServices(Option.of(instantTime), true);
       metadataWriter.update(commitMeta, instantTime);
-      metaClient.getActiveTimeline().saveAsComplete(
-          INSTANT_GENERATOR.createNewInstant(State.INFLIGHT, 
HoodieTimeline.COMMIT_ACTION, instantTime),
-          Option.of(commitMeta));
+      createCommit(metaClient, 
metaClient.getTimelineLayout().getCommitMetadataSerDe(), instantTime,

Review Comment:
   > is the change related with the cleaner fixes?
   
   Yes, this test change is also related to the cleaner fix.
   
     The test creates requested instants at `now - N minutes`, but the previous 
`saveAsComplete` path assigned completion time based on the instant file 
modification time, which is effectively the current test execution time.
   
     After `KEEP_LATEST_BY_HOURS` was changed to use completion time, all those 
synthetic commits appeared recently completed, changing the archival result 
from 8 retained instants to 10. Using `createCommit(..., 
Option.of(instantTime), ...)` assigns the completion time intended by the test 
and keeps requested time and completion time aligned. This preserves the 
original synthetic timeline semantics while testing the new 
completion-time-based behavior.



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