fix(core): stop forcing the timeline history folder onto pre-v8 tables - #19565
Draft
yihua wants to merge 1 commit into
Draft
fix(core): stop forcing the timeline history folder onto pre-v8 tables#19565yihua wants to merge 1 commit into
yihua wants to merge 1 commit into
Conversation
Table creation hardcoded the timeline layout version 2 history folder into hoodie.archivelog.folder regardless of the table version being created. A table below version 8 uses timeline layout version 1, which resolves its archived timeline through that config, so those tables archived into .hoodie/history instead of .hoodie/archived. Let the table builder supply the default instead, and pass through only a value the user configured.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19565 +/- ##
=========================================
Coverage 76.84% 76.84%
- Complexity 32379 32380 +1
=========================================
Files 2522 2522
Lines 139106 139104 -2
Branches 16713 16713
=========================================
+ Hits 106892 106894 +2
Misses 24621 24621
+ Partials 7593 7589 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the issue this Pull Request addresses
Closes #19561
Summary and Changelog
Table creation passed
TIMELINE_HISTORY_PATH.defaultValue()(history) intosetArchiveLogFolder(...)regardless of the table version being created.A table below version 8 uses timeline layout version 1, and
TimelinePathProviderV1.getTimelineHistoryPath()resolves the archived timeline throughhoodie.archivelog.folder. Forcing that config to the layout version 2 value meant such a table archived into.hoodie/archived's sibling.hoodie/history, diverging from the conventional location.Changes:
TableBuilder.build()suppliesARCHIVELOG_FOLDER.defaultValue(), and pass through only a value the user configured. Five call sites:StreamSync,BootstrapExecutor,BootstrapExecutorUtils,HoodieSparkSqlWriter(both table creation branches), and the FlinkStreamerUtil.HoodieSparkSqlWriterswitches fromgetStringOrDefaulttogetStringso an unset config reaches the builder as null rather than as the layout version 2 default.TestStreamSynccoverage across table versions 6, 7, 8 and 9, asserting both the persisted config and the resolved archive path, plus a case pinning that an explicitly configuredhoodie.timeline.history.pathis still honoured.The metadata table already handled this correctly through
HoodieBackedTableMetadataWriterTableVersionSix, which returnsARCHIVELOG_FOLDER.defaultValue(); it is unchanged.The active timeline is unaffected:
TimelinePathProviderV1hardcodes.hoodieand never consultshoodie.timeline.path.Impact
Newly created tables below version 8 archive into
.hoodie/archived, matching the conventional location and the metadata table.Tables at version 8 and above now record
hoodie.archivelog.folder=archivedwhere these paths previously wrotehistory. That config has exactly one reader in the codebase,TimelinePathProviderV1, which is unreachable at layout version 2, so it is inert for those tables. It becomes meaningful again after a downgrade to version 7 or below, where the new value is the correct one:EightToSevenDowngradeHandlerwrites the converted archived timeline to a hardcoded.hoodie/archived, so a table carryinghistorypreviously ended up pointing at an empty directory after downgrade.Existing tables are not modified. Any created below version 8 keep
historyin their properties and continue to resolve consistently, since the persisted value is what is read.No public API change.
Risk Level
low
The changed config has a single production reader, selected only for timeline layout version 1, so behaviour at layout version 2 is unchanged in effect. Verified with unit tests across four table versions, and by confirming that reverting the change reproduces the original symptom (
expected: <archived> but was: <history>at table version 6).Documentation Update
none
No config is added and no default value changes; this removes a hardcoded override that bypassed an existing default.
Contributor's checklist