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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieMetadataWriteUtils.java:
##########
@@ -147,14 +167,37 @@ public static HoodieWriteConfig createMetadataWriteConfig(
       HoodieTableVersion datatableVersion) {
     String tableName = writeConfig.getTableName() + METADATA_TABLE_NAME_SUFFIX;
     boolean isStreamingWritesToMetadataEnabled = 
writeConfig.isMetadataStreamingWritesEnabled(datatableVersion);
-    WriteConcurrencyMode concurrencyMode = isStreamingWritesToMetadataEnabled
-        ? WriteConcurrencyMode.NON_BLOCKING_CONCURRENCY_CONTROL : 
WriteConcurrencyMode.SINGLE_WRITER;
-    HoodieLockConfig lockConfig = isStreamingWritesToMetadataEnabled
-        ? 
HoodieLockConfig.newBuilder().withLockProvider(InProcessLockProvider.class).build()
 : HoodieLockConfig.newBuilder().build();
-    // HUDI-9407 tracks adding support for separate lock configuration for 
MDT. Until then, all writes to MDT will happen within data table lock.
-
-    if (isStreamingWritesToMetadataEnabled) {
+    WriteConcurrencyMode metadataWriteConcurrencyMode =
+        
WriteConcurrencyMode.valueOf(writeConfig.getMetadataConfig().getWriteConcurrencyMode());
+
+    WriteConcurrencyMode concurrencyMode;
+    HoodieLockConfig lockConfig;
+    if (metadataWriteConcurrencyMode.supportsMultiWriter()) {
+      // Configuring Multi-writer directly on metadata table is intended for 
executing table service plans, not for writes.
+      checkState(!isStreamingWritesToMetadataEnabled,
+          "Streaming writes to metadata table must be disabled when using 
multi-writer concurrency mode "

Review Comment:
   We have a check method: `WriteConcurrencyMode#supportsMultiWriter`, `OCC` 
and `NBCC` both means to support multiple writers.
   
   What if the user just set up the MDT concurrency mode as NBCC and also 
`isStreamingWritesToMetadataEnabled` as true, it should work for your case 
since NBCC is more flexible than OCC(the current patch only executes the plans 
instead of schedule).



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