Skip to content

fix(core): stop forcing the timeline history folder onto pre-v8 tables - #19565

Draft
yihua wants to merge 1 commit into
apache:masterfrom
yihua:fix-v6-archive-folder
Draft

fix(core): stop forcing the timeline history folder onto pre-v8 tables#19565
yihua wants to merge 1 commit into
apache:masterfrom
yihua:fix-v6-archive-folder

Conversation

@yihua

@yihua yihua commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Describe the issue this Pull Request addresses

Closes #19561

Summary and Changelog

Table creation passed TIMELINE_HISTORY_PATH.defaultValue() (history) into setArchiveLogFolder(...) regardless of the table version being created.

A table below version 8 uses timeline layout version 1, and TimelinePathProviderV1.getTimelineHistoryPath() resolves the archived timeline through hoodie.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:

  • Remove the hardcoded value from the table creation paths so TableBuilder.build() supplies ARCHIVELOG_FOLDER.defaultValue(), and pass through only a value the user configured. Five call sites: StreamSync, BootstrapExecutor, BootstrapExecutorUtils, HoodieSparkSqlWriter (both table creation branches), and the Flink StreamerUtil.
  • HoodieSparkSqlWriter switches from getStringOrDefault to getString so an unset config reaches the builder as null rather than as the layout version 2 default.
  • Add TestStreamSync coverage 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 configured hoodie.timeline.history.path is still honoured.

The metadata table already handled this correctly through HoodieBackedTableMetadataWriterTableVersionSix, which returns ARCHIVELOG_FOLDER.defaultValue(); it is unchanged.

The active timeline is unaffected: TimelinePathProviderV1 hardcodes .hoodie and never consults hoodie.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=archived where these paths previously wrote history. 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: EightToSevenDowngradeHandler writes the converted archived timeline to a hardcoded .hoodie/archived, so a table carrying history previously ended up pointing at an empty directory after downgrade.

Existing tables are not modified. Any created below version 8 keep history in 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

  • Read through contributor's guide
  • Enough context is provided in the sections above
  • Adequate tests were added if applicable

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.
@github-actions github-actions Bot added the size:S PR with lines of changes in (10, 100] label Aug 8, 2026
@codecov-commenter

codecov-commenter commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.84%. Comparing base (65cf7e8) to head (f0aa5cf).
⚠️ Report is 8 commits behind head on master.

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     
Components Coverage Δ
hudi-common 83.27% <ø> (+<0.01%) ⬆️
hudi-client 81.98% <ø> (-0.01%) ⬇️
hudi-flink 84.70% <100.00%> (ø)
hudi-spark-datasource 70.60% <100.00%> (+<0.01%) ⬆️
hudi-utilities 73.63% <100.00%> (+<0.01%) ⬆️
hudi-cli 15.32% <ø> (ø)
hudi-hadoop 63.53% <ø> (+0.03%) ⬆️
hudi-sync 75.11% <ø> (ø)
hudi-io 79.36% <ø> (-0.10%) ⬇️
hudi-timeline-service 83.44% <ø> (ø)
hudi-cloud 64.06% <ø> (ø)
hudi-kafka-connect 53.20% <ø> (ø)
Flag Coverage Δ
common-and-other-modules 50.14% <33.33%> (+<0.01%) ⬆️
flink-integration-tests 48.94% <100.00%> (-0.01%) ⬇️
hadoop-mr-java-client 43.73% <ø> (+0.01%) ⬆️
integration-tests 13.57% <0.00%> (+<0.01%) ⬆️
spark-client-hadoop-common 49.63% <ø> (+<0.01%) ⬆️
spark-java-tests 51.58% <40.00%> (+<0.01%) ⬆️
spark-scala-tests 45.97% <40.00%> (-0.01%) ⬇️
utilities 36.61% <60.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...c/main/java/org/apache/hudi/util/StreamerUtil.java 72.49% <100.00%> (ø)
...n/scala/org/apache/hudi/HoodieSparkSqlWriter.scala 78.44% <100.00%> (ø)
...va/org/apache/hudi/cli/BootstrapExecutorUtils.java 74.64% <100.00%> (-0.18%) ⬇️
...che/hudi/utilities/streamer/BootstrapExecutor.java 74.15% <100.00%> (-0.29%) ⬇️
...org/apache/hudi/utilities/streamer/StreamSync.java 77.89% <100.00%> (ø)

... and 13 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hudi-bot

hudi-bot commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S PR with lines of changes in (10, 100]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Table creation writes the timeline layout v2 history folder into hoodie.archivelog.folder on tables below version 8

3 participants