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


##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/sink/TestStreamWriteOperatorCoordinator.java:
##########
@@ -247,34 +247,16 @@ void testSyncMetadataTable() throws Exception {
     assertThat("One instant need to sync to metadata table", 
completedTimeline.countInstants(), is(7));
     assertThat(completedTimeline.nthFromLastInstant(1).get().getTimestamp(), 
is(instant + "001"));
     assertThat(completedTimeline.nthFromLastInstant(1).get().getAction(), 
is(HoodieTimeline.COMMIT_ACTION));
-    // write another 2 commits
-    for (int i = 7; i < 8; i++) {
+
+    // write another 27 commits to trigger the first clean
+    for (int i = 7; i < 34; i++) {
       instant = mockWriteWithMetadata();
-      metadataTableMetaClient.reloadActiveTimeline();
-      completedTimeline = 
metadataTableMetaClient.getActiveTimeline().filterCompletedInstants();
-      assertThat("One instant need to sync to metadata table", 
completedTimeline.countInstants(), is(i + 1));

Review Comment:
   Got it, can we set up the MDT `hoodie.cleaner.commits.retained` as:
   
   ```java
   min(`hoodie.cleaner.commits.retained` from DT, 
HoodieMetadataConfig.DEFAULT_METADATA_CLEANER_COMMITS_RETAINED)
   ```



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