You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "the-other-tim-brown (via GitHub)" <gi...@apache.org> on 2025/09/29 18:47:55 UTC

[PR] perf: Improvements to CompletionTimeQueryViewV2 [hudi]

the-other-tim-brown opened a new pull request, #14013:
URL: https://github.com/apache/hudi/pull/14013

   ### Describe the issue this Pull Request addresses
   
   <!-- Either describe the issue inline here with motivation behind the changes 
        (or) link to an issue by including `Closes #<issue-number>` for context. 
        If this PR includes changes to the storage format, public APIs,
        or has breaking changes, use `!` (e.g., feat!: ...) -->
   Currently, the CompletionTimeQueryViewV2 implementation will eagerly load up to 3 days of history data from the archived timeline. This data may never be used so this read operation just introduces extra overhead and should be avoided.
   
   ### Summary and Changelog
   
   <!-- Short, plain-English summary of what users gain or what changed in behavior.
        Followed by a detailed log of all the changes. Highlight if any code was copied. -->
   The initialization of the `CompletionTimeQueryViewV2` will now only consider the active timeline when creating the instance. It will then load from the archived timeline when there is a request for a completion time that is not in the active timeline with the same approach as before where we will eagerly fetch the last 3 days by default. 
   
   Changes:
   - Makes the archived timeline read lazy
   - Adds optimizations to avoid extra `exists` checks
   
   ### Impact
   
   <!-- Describe any public API or user-facing feature change or any performance impact. -->
   Improves performance by reducing IO and listing calls
   
   ### Risk Level
   
   <!-- Accepted values: none, low, medium or high. Other than `none`, explain the risk.
        If medium or high, explain what verification was done to mitigate the risks. -->
   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 follow the 
     [instruction](https://hudi.apache.org/contribute/developer-setup#website) to make changes to the website. -->
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [ ] Enough context is provided in the sections above
   - [ ] Adequate tests were added if applicable
   


-- 
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] perf: Improvements to CompletionTimeQueryViewV2 [hudi]

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


-- 
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] perf: Improvements to CompletionTimeQueryViewV2 [hudi]

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1e97dfff243493eab7b77d9cf9621b1d49cef834",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8936",
       "triggerID" : "1e97dfff243493eab7b77d9cf9621b1d49cef834",
       "triggerType" : "PUSH"
     }, {
       "hash" : "04df6c8c9eee712513a683afbd829cbd7842aac0",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8938",
       "triggerID" : "04df6c8c9eee712513a683afbd829cbd7842aac0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1e97dfff243493eab7b77d9cf9621b1d49cef834 Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8936) 
   * 04df6c8c9eee712513a683afbd829cbd7842aac0 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8938) 
   
   <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] perf: Improvements to CompletionTimeQueryViewV2 [hudi]

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1e97dfff243493eab7b77d9cf9621b1d49cef834",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8936",
       "triggerID" : "1e97dfff243493eab7b77d9cf9621b1d49cef834",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1e97dfff243493eab7b77d9cf9621b1d49cef834 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8936) 
   
   <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] perf: Improvements to CompletionTimeQueryViewV2 [hudi]

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


##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/versioning/v2/CompletionTimeQueryViewV2.java:
##########
@@ -102,7 +106,14 @@ public CompletionTimeQueryViewV2(HoodieTableMetaClient metaClient) {
   public CompletionTimeQueryViewV2(HoodieTableMetaClient metaClient, String eagerLoadInstant) {
     this.metaClient = metaClient;
     this.instantTimeToCompletionTimeMap = new ConcurrentHashMap<>();
-    this.cursorInstant = InstantComparison.minInstant(eagerLoadInstant, metaClient.getActiveTimeline().firstInstant().map(HoodieInstant::requestedTime).orElse(""));
+    this.cursorInstant = metaClient.getActiveTimeline().firstInstant().map(HoodieInstant::requestedTime).orElse("");

Review Comment:
   Hi, the `eagerLoadInstant` is not configurable now, wondering how this patch could improve the performance?
   can we by default set the eagerLoadInstant as the first active instant and not load loading the archived timeline instead? Not a fan of these flags variables introduced.



-- 
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] perf: Improvements to CompletionTimeQueryViewV2 [hudi]

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1e97dfff243493eab7b77d9cf9621b1d49cef834",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8936",
       "triggerID" : "1e97dfff243493eab7b77d9cf9621b1d49cef834",
       "triggerType" : "PUSH"
     }, {
       "hash" : "04df6c8c9eee712513a683afbd829cbd7842aac0",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8938",
       "triggerID" : "04df6c8c9eee712513a683afbd829cbd7842aac0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 04df6c8c9eee712513a683afbd829cbd7842aac0 Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8938) 
   
   <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] perf: Improvements to CompletionTimeQueryViewV2 [hudi]

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


##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/LSMTimeline.java:
##########
@@ -169,15 +168,17 @@ public static int latestSnapshotVersion(HoodieTableMetaClient metaClient, Storag
    * Returns all the valid snapshot versions.
    */
   public static List<Integer> allSnapshotVersions(HoodieTableMetaClient metaClient, StoragePath archivePath) throws IOException {
-    if (!metaClient.getStorage().exists(archivePath)) {

Review Comment:
   I think, as the long-term solution, it makes sense to remove the `exists` API to avoid such exists calls and follow the pattern of a try-catch approach for FS call efficiency.



-- 
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] perf: Improvements to CompletionTimeQueryViewV2 [hudi]

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1e97dfff243493eab7b77d9cf9621b1d49cef834",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8936",
       "triggerID" : "1e97dfff243493eab7b77d9cf9621b1d49cef834",
       "triggerType" : "PUSH"
     }, {
       "hash" : "04df6c8c9eee712513a683afbd829cbd7842aac0",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8938",
       "triggerID" : "04df6c8c9eee712513a683afbd829cbd7842aac0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1e97dfff243493eab7b77d9cf9621b1d49cef834 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8936) 
   * 04df6c8c9eee712513a683afbd829cbd7842aac0 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8938) 
   
   <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] perf: Improvements to CompletionTimeQueryViewV2 [hudi]

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

   CI failure is due to an known issue #14014 which is irrelevant to this PR.


-- 
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] perf: Improvements to CompletionTimeQueryViewV2 [hudi]

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1e97dfff243493eab7b77d9cf9621b1d49cef834",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1e97dfff243493eab7b77d9cf9621b1d49cef834",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1e97dfff243493eab7b77d9cf9621b1d49cef834 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] perf: Improvements to CompletionTimeQueryViewV2 [hudi]

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1e97dfff243493eab7b77d9cf9621b1d49cef834",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8936",
       "triggerID" : "1e97dfff243493eab7b77d9cf9621b1d49cef834",
       "triggerType" : "PUSH"
     }, {
       "hash" : "04df6c8c9eee712513a683afbd829cbd7842aac0",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "04df6c8c9eee712513a683afbd829cbd7842aac0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1e97dfff243493eab7b77d9cf9621b1d49cef834 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8936) 
   * 04df6c8c9eee712513a683afbd829cbd7842aac0 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