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

   ### Describe the issue this Pull Request addresses
   
   This closes #19086 
   
   Hudi now needs to distinguish the current log format version from the inline 
log block format version. The native log format should use log format version 
`2`, while existing inline log files should continue writing inline block 
envelopes as version `1`.
   
   Without separating these constants, bumping 
`HoodieLogFormat.CURRENT_VERSION` would also make `HoodieLogFormatWriter` emit 
inline log blocks as version `2`, even though the inline log block feature 
flags and compatibility behavior remain tied to version `1`. This PR explicitly 
calls out that storage-format split.
   
   ### Summary and Changelog
   
   This PR switches the current log format version to `2` while preserving 
inline log writes at format version `1`.
   
   - Bumped `HoodieLogFormat.CURRENT_VERSION` from `1` to `2`.
   - Added `HoodieLogFormat.INLINE_LOG_FORMAT_VERSION = 1`.
   - Updated `HoodieLogFormatWriter` to write inline log blocks with 
`INLINE_LOG_FORMAT_VERSION`.
   - Updated `HoodieNativeLogFormatWriter` to use 
`HoodieLogFormat.CURRENT_VERSION` for native log footer metadata instead of a 
separate hard-coded native version constant.
   - Updated `TestHoodieLogFormatVersion` to assert the current and inline 
version values and feature behavior.
   - Updated manual inline block construction in `TestHoodieLogFormat` to use 
`INLINE_LOG_FORMAT_VERSION`.
   
   ### Impact
   
   This changes internal log format versioning behavior for native logs by 
making version `2` the shared current log format version. Inline logs remain 
compatible because their block writer continues emitting version `1`.
   
   There is no new user-facing config or public API behavior change. The 
affected area is core log writing and log-format metadata, especially inline 
MOR log block serialization and native log footer metadata.
   
   ### Risk Level
   
   medium
   
   This touches storage-format version constants and core log writer paths. The 
risk is mitigated by keeping inline log serialization pinned to version `1`, 
updating tests that manually serialize inline log blocks, and validating with:
   
   - `mvn -pl hudi-common -DskipITs -Dtest=TestHoodieLogFormatVersion test`
   - `mvn -pl hudi-hadoop-common -am -DskipITs 
-Dtest=TestHoodieLogFormatWriter,TestHoodieLogFormat 
-Dsurefire.failIfNoSpecifiedTests=false test`
   - `mvn -pl hudi-client/hudi-client-common -am -DskipTests -DskipITs compile`
   
   ### Documentation Update
   
   none
   
   This is an internal log format versioning change with no new user-facing 
configuration or documented workflow. Inline log compatibility is preserved by 
continuing to write inline log blocks as version `1`.
   
   ### 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: [email protected]

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

Reply via email to