You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "TheR1sing3un (via GitHub)" <gi...@apache.org> on 2024/08/12 07:30:38 UTC

[PR] [MINOR] avoid repeated write behavior in ut [hudi]

TheR1sing3un opened a new pull request, #11755:
URL: https://github.com/apache/hudi/pull/11755

   > case  
   
   
   When I run a ut in `TestHoodieCompactor`, I found that every compaction will write a same merged file 2 times.
   <img width="547" alt="image" src="https://github.com/user-attachments/assets/21818578-b514-43a4-8358-138b40b2ae69">
   > reason
   1. `WriteStatus::collect` is called after compaction.
   <img width="1095" alt="image" src="https://github.com/user-attachments/assets/4e0e7017-c02e-4cab-8d58-b6caa13a768d">
   2. `collect` will cause RDD computation again.     
   3.  But RDD cache about this RDD id has been removed when compaction is completed.
   <img width="1304" alt="image" src="https://github.com/user-attachments/assets/14558ed1-fd70-4db7-99d5-59bfe490176d">
   <img width="674" alt="image" src="https://github.com/user-attachments/assets/f4cef1cd-5170-4809-99cd-281b57878f52">
   
   4. So it will cause computation again from this stage. `HoodieCompactor::compact`
   <img width="1164" alt="image" src="https://github.com/user-attachments/assets/e1e34ad8-255c-402c-b485-222d8d92b2f7">
   
   
   
   ### Change Logs
   
   _Describe context and summary for this change. Highlight if any code was copied._
   
   1. set stats in metadata after compaction
   6. fix wrong usage about HoodieWriteMetadata which cause the repeated write behavior in ut
   
   ### Impact
   
   _Describe any public API or user-facing feature change or any performance impact._
   none
   ### Risk level (write none, low medium or high below)
   none
   _If medium or high, explain what verification was done to mitigate the risks._
   
   ### 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
   - [x] 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] [MINOR] avoid repeated write behavior in ut [hudi]

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f8b0e909c93c19ff8dfcd134d2f4a4fa10c7f0fd",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=25115",
       "triggerID" : "f8b0e909c93c19ff8dfcd134d2f4a4fa10c7f0fd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f8b0e909c93c19ff8dfcd134d2f4a4fa10c7f0fd Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=25115) 
   
   <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] [MINOR] avoid repeated write behavior in ut [hudi]

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/compact/RunCompactionActionExecutor.java:
##########
@@ -125,6 +125,7 @@ public HoodieWriteMetadata<HoodieData<WriteStatus>> execute() {
       compactionMetadata.setWriteStatuses(statuses);
       compactionMetadata.setCommitted(false);
       compactionMetadata.setCommitMetadata(Option.of(metadata));
+      compactionMetadata.setWriteStats(updateStatusMap);

Review Comment:
   > Does line 116 already set up the write stat?
   
   Yes, same stats value, but line 166 set up it in HoodieCommitMetadata but not in HoodieWriteMetadata. I think we should also set it in HoodieWriteMetadata.



-- 
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] [MINOR] avoid repeated write behavior in ut [hudi]

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/compact/RunCompactionActionExecutor.java:
##########
@@ -125,6 +125,7 @@ public HoodieWriteMetadata<HoodieData<WriteStatus>> execute() {
       compactionMetadata.setWriteStatuses(statuses);
       compactionMetadata.setCommitted(false);
       compactionMetadata.setCommitMetadata(Option.of(metadata));
+      compactionMetadata.setWriteStats(updateStatusMap);

Review Comment:
   Does line 116 already set up the write stat?



-- 
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] [MINOR] avoid repeated write behavior in ut [hudi]

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f8b0e909c93c19ff8dfcd134d2f4a4fa10c7f0fd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f8b0e909c93c19ff8dfcd134d2f4a4fa10c7f0fd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f8b0e909c93c19ff8dfcd134d2f4a4fa10c7f0fd 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] [MINOR] avoid repeated write behavior in ut [hudi]

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

   > how about disable release cache data in compact ut?
   
   Yes, it is also a great solution! But the `cache-release` logic is related to `auto-commit`.


-- 
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] [MINOR] avoid repeated write behavior in ut [hudi]

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


-- 
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] [MINOR] avoid repeated write behavior in ut [hudi]

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f8b0e909c93c19ff8dfcd134d2f4a4fa10c7f0fd",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=25115",
       "triggerID" : "f8b0e909c93c19ff8dfcd134d2f4a4fa10c7f0fd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f8b0e909c93c19ff8dfcd134d2f4a4fa10c7f0fd Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=25115) 
   
   <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