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

   ### Describe the issue this Pull Request addresses
   
   closes #20812
   
   ### Summary and Changelog
   
   On a Spark executor, a metadata table write can pass 
`HoodieMetadataPayload.getInsertValue` an equal copy of the metadata schema 
instead of the generated class's own schema object. That happens when the write 
handle interns its schema before the payload class loads. The copy fails the 
reference check, and the fallback branch writes at meta-field offsets the 
metadata schema doesn't have, so the write fails with 
`ArrayIndexOutOfBoundsException`. Now any schema without `_hoodie_record_key` 
gets the generated record too, while the reference check stays as the fast 
path. `TestHoodieMetadataPayload` used to expect the exception for an equal 
copy. It now expects the generated record.
   
   #19560 (for #19559) changes the same condition by checking the record name. 
Whichever of the two merges first, the other rebases onto it.
   
   ### Impact
   
   Metadata table writes no longer fail at random on executors. No API or 
config change.
   
   ### Risk Level
   
   low. Schemas that start with the meta fields still take the same branch as 
before.
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] 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: [email protected]

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

Reply via email to