You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "lliangyu-lin (via GitHub)" <gi...@apache.org> on 2025/02/17 21:52:39 UTC

[PR] [HUDI-9039] Run do init table transaction only when required [hudi]

lliangyu-lin opened a new pull request, #12847:
URL: https://github.com/apache/hudi/pull/12847

   ### Change Logs
   
   * Add condition before the initTable transaction to check whether table upgrade / downgrade is needed and if metadata table is enabled.
   * This avoids lock contention when many writes tries to run doInitTable transaction even though it's not necessary.
   
   ### Impact
   
   Avoids lock contention when many writes tries to run doInitTable transaction
   
   ### Risk level (write none, low medium or high below)
   
   Low
   
   ### Documentation Update
   
   _Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none"._
   
   - _The config description must be updated if new configs are added or the default value of the configs are changed_
   - _Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
     ticket number here and follow the [instruction](https://hudi.apache.org/contribute/developer-setup#website) to make
     changes to the website._
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Change Logs and Impact were stated clearly
   - [x] Adequate tests were added if applicable
   - [ ] CI passed
   


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [HUDI-9039] Run do init table transaction only when required [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #12847:
URL: https://github.com/apache/hudi/pull/12847#issuecomment-2664226458

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c539025ac1185f1065283a3da68fee3f5379ce44",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=3667",
       "triggerID" : "c539025ac1185f1065283a3da68fee3f5379ce44",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c539025ac1185f1065283a3da68fee3f5379ce44 Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=3667) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [HUDI-9039] Run do init table transaction only when required [hudi]

Posted by "CTTY (via GitHub)" <gi...@apache.org>.
CTTY commented on code in PR #12847:
URL: https://github.com/apache/hudi/pull/12847#discussion_r1958806353


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java:
##########
@@ -1299,6 +1299,10 @@ protected void doInitTable(WriteOperationType operationType, HoodieTableMetaClie
       ownerInstant = Option.of(metaClient.createNewInstant(HoodieInstant.State.INFLIGHT, CommitUtils.getCommitActionType(operationType,
           metaClient.getTableType()), instantTime.get()));
     }
+    boolean requiresInitTable = needsUpgradeOrDowngrade(metaClient) || config.isMetadataTableEnabled();
+    if (!requiresInitTable) {

Review Comment:
   nit: maybe add a comment like `// short-circuit the transaction if no upgrade/MDT init is needed`



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [HUDI-9039] Run do init table transaction only when required [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #12847:
URL: https://github.com/apache/hudi/pull/12847#issuecomment-2664133377

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c539025ac1185f1065283a3da68fee3f5379ce44",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c539025ac1185f1065283a3da68fee3f5379ce44",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c539025ac1185f1065283a3da68fee3f5379ce44 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [HUDI-9039] Run do init table transaction only when required [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #12847:
URL: https://github.com/apache/hudi/pull/12847#issuecomment-2664135193

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c539025ac1185f1065283a3da68fee3f5379ce44",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=3667",
       "triggerID" : "c539025ac1185f1065283a3da68fee3f5379ce44",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c539025ac1185f1065283a3da68fee3f5379ce44 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=3667) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [HUDI-9039] Run do init table transaction only when required [hudi]

Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 merged PR #12847:
URL: https://github.com/apache/hudi/pull/12847


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org