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

   In the consistent-bucket mode, the creation of the `hash_metadata_file` may 
be read by another task or job. In this case, the Metadata may be loaded 
incorrectly because the `hash_metadata_file` may be read in the intermediate 
state.
   For example, two task load `p_date=20241202` partition's hash-metadata:
   1. task-a load from fs but found nothing.
   2. task-a start to create initial-hash-metadata-file
   3. initial-hash-metadata-file created
   4. task-b load form fs and found created but empty initial-hash-metadata-file
   5. task-b throw exception
   6. task-a write metadata content to initial-hash-metadata-file
   
   So task-b can see the ntermediate state of hash-metadata-file.
   
   I wrote a UT to verify it.
   <img width="1322" alt="image" 
src="https://github.com/user-attachments/assets/ad8d2280-ada1-44ca-9f93-99fcdee825a7";>
   
   <img width="1124" alt="image" 
src="https://github.com/user-attachments/assets/6bf01b5b-6fdb-4e6d-b909-b035b54bb000";>
   
   
   
   ### Change Logs
   
   1. using rename to create consistent-hash-metadata file
   
   _Describe context and summary for this change. Highlight if any code was 
copied._
   
   ### Impact
   
   _Describe any public API or user-facing feature change or any performance 
impact._
   
   ### Risk level (write none, low medium or high below)
   
   _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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to