xushiyan commented on code in PR #7638:
URL: https://github.com/apache/hudi/pull/7638#discussion_r1199700498


##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/client/functional/TestHoodieBackedMetadata.java:
##########
@@ -861,6 +862,33 @@ public void testMetadataTableWithPendingCompaction(boolean 
simulateFailedCompact
     }
   }
 
+  /**
+   * Tests to make sure that compaction won't be delayed forever due to a 
stuck pending commit
+   * */
+  @Test
+  public void testMetadataTableWithLongLog() throws Exception {
+    HoodieTableType tableType = COPY_ON_WRITE;
+    init(tableType, false);
+    writeConfig = getWriteConfigBuilder(true, true, false)
+        .withMetadataConfig(HoodieMetadataConfig.newBuilder()
+            .enable(true)
+            .enableFullScan(true)
+            .enableMetrics(false)
+            .build()).build();
+    initWriteConfigAndMetatableWriter(writeConfig, true);
+
+    HoodieException e =  assertThrows(HoodieException.class, () -> {
+      for (int i = 0; i < 
HoodieBackedTableMetadataWriter.MAX_LOG_FILE_LIST_LENGTH + 100; i++) {

Review Comment:
   this test actually does 1100 commits to finish.



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##########
@@ -1040,6 +1043,24 @@ protected void compactIfNecessary(BaseHoodieWriteClient 
writeClient, String inst
     }
   }
 
+  /**
+   * If there is an instant that is stuck pending, compaction will never occur 
and the log length will grow unbounded.
+   * Throw an exception if MAX_LOG_FILE_LIST_LENGTH is exceeded.
+   */
+  private void checkLogFileListLength() {

Review Comment:
   this should be static and parameterize the max length



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