Skip to content

HDDS-14939. Implement version file rewrite logic for path migration across metadata history#10067

Open
sreejasahithi wants to merge 5 commits intoapache:masterfrom
sreejasahithi:HDDS-14939
Open

HDDS-14939. Implement version file rewrite logic for path migration across metadata history#10067
sreejasahithi wants to merge 5 commits intoapache:masterfrom
sreejasahithi:HDDS-14939

Conversation

@sreejasahithi
Copy link
Copy Markdown
Contributor

@sreejasahithi sreejasahithi commented Apr 10, 2026

What changes were proposed in this pull request?

This change implements the logic to rewrite table metadata version files across the metadata history, enabling path migration from a source prefix to a target prefix.

Traversal should start from the provided endMetadata (current or specified version) and iterate backwards through previous metadata version files until reached the startVersion provided if any(if not then till beginning). We also need to collect all the snapshots from each traversed historical metadata version.

For each metadata version file we can take help of iceberg's RewriteTablePathUtil to rewrite absolute file paths in it from sourcePrefix -> targetPrefix and then we have to add the rewritten file to the staging location.

We should also update copy plan with staging -> final path mappings for each metadata version file rewritten.

What is the link to the Apache JIRA

HDDS-14939

How was this patch tested?

Added test cases
Green CI:
https://github.com/sreejasahithi/ozone/actions/runs/24237563462

@sreejasahithi sreejasahithi marked this pull request as ready for review April 13, 2026 11:47
@sreejasahithi sreejasahithi marked this pull request as draft April 14, 2026 13:20
Copy link
Copy Markdown
Contributor

@ashishkumar50 ashishkumar50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sreejasahithi Thanks for working on this. Please find the comments inline.
Also can you create a utility class and put common methods there instead adding everything in the same class.

@sreejasahithi sreejasahithi marked this pull request as ready for review April 17, 2026 04:34
Copy link
Copy Markdown
Contributor

@ashishkumar50 ashishkumar50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sreejasahithi overall LGTM, some minor nits.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants