xuzifu666 commented on code in PR #10801:
URL: https://github.com/apache/hudi/pull/10801#discussion_r1510519771


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieTableServiceClient.java:
##########
@@ -327,8 +327,10 @@ protected void completeCompaction(HoodieCommitMetadata 
metadata, HoodieTable tab
     try {
       this.txnManager.beginTransaction(Option.of(compactionInstant), 
Option.empty());
       finalizeWrite(table, compactionCommitTime, writeStats);
-      // commit to data table after committing to metadata table.
-      writeTableMetadata(table, compactionCommitTime, metadata, 
context.emptyHoodieData());
+      // if metatable is enable, then commit to data table after committing to 
metadata table.
+      if (config.getMetadataConfig().enabled()) {
+        writeTableMetadata(table, compactionCommitTime, metadata, 
context.emptyHoodieData());
+      }
       LOG.info("Committing Compaction " + compactionCommitTime + ". Finished 
with result " + metadata);

Review Comment:
   writeTableMetadata judge whether to execute commit data to metadata table 
had two conditions:
   **1. mdt enable  2. mdt dir exists;**
   user if want to stop commit to metadata who enable it before(in the 
condition metadata dir would exists),can not stop compaction operation commit 
data to metadata by set hoodie.metadata.enable=false,currently could not 
support it which is not fitable @danny0405 @CTTY 
   
![1709519127428.png](https://github.com/apache/hudi/assets/10645422/e3eebb7c-40e9-4d56-a5bb-d9b413c40268)
   
   



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