stream2000 commented on code in PR #8609:
URL: https://github.com/apache/hudi/pull/8609#discussion_r1211815992


##########
hudi-common/src/test/java/org/apache/hudi/common/table/TestHoodieTableConfig.java:
##########
@@ -143,4 +143,28 @@ public void testUpdateRecovery(boolean 
shouldPropsFileExist) throws IOException
     config = new HoodieTableConfig(fs, metaPath.toString(), null, null);
     assertEquals(6, config.getProps().size());
   }
+
+  @Test

Review Comment:
   Could we add a test that has one thread reading the table config and the 
other thread update the config concurrently and checking if we can read the 
properties properly? 
   
   We can use the following code directly to test: 
   ```java
    @Test
     public void testConcurrentlyUpdate() throws ExecutionException, 
InterruptedException {
       final ExecutorService executor = Executors.newFixedThreadPool(2);
       Future updaterFuture = executor.submit(() -> {
         for (int i = 0; i < 100; i++) {
           Properties updatedProps = new Properties();
           updatedProps.setProperty(HoodieTableConfig.NAME.key(), "test-table" 
+ i);
           updatedProps.setProperty(HoodieTableConfig.PRECOMBINE_FIELD.key(), 
"new_field" + i);
           HoodieTableConfig.update(fs, metaPath, updatedProps);
         }
       });
   
       Future readerFuture = executor.submit(() -> {
         for (int i = 0; i < 100; i++) {
           // Try to load the table properties, won't throw any exception
           new HoodieTableConfig(fs, metaPath.toString(), null, null);
         }
       });
   
       updaterFuture.get();
       readerFuture.get();
     }
   ```



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