HCR bug fix: Retention job should use Hadoop Path to write data_manifest.json#633
Merged
Merged
Conversation
4 tasks
7e698d7 to
d2af8d5
Compare
…st paths Retention backup-manifest writing used java.nio.file.Paths to derive the parent directory of a data file. Paths is not URI-aware: it collapses hdfs://authority/... into hdfs:/authority/..., dropping the authority. The mangled path then resolved against the default filesystem root and failed with "Permission denied ... inode=/". This bit tables whose newer data files are stored as fully-qualified hdfs:// URIs while older ones are bare paths. Use Hadoop Path (which preserves scheme + authority) via a testable dataFileParent() helper. OperationsBackupPathTest covers the qualified and bare path forms, plus a negative test that exercises the java.nio.file.Paths derivation and asserts it produces the broken, root-rooted destination path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
d2af8d5 to
93415f4
Compare
maluchari
approved these changes
Jun 16, 2026
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.
Summary
Retention with backup enabled failed with
Permission denied ... access=WRITE, inode="/"when writingdata_manifest.json. The root cause is that backup-manifest path derivation usedjava.nio.file.Paths, which is not URI-aware and collapseshdfs://authority/...intohdfs:/authority/..., dropping the authority. The mangled path then resolved against the default filesystem root and tried tomkdirsa bogus top-level directory. This affected tables whose newer data files are stored as fully-qualifiedhdfs://URIs while older partitions use bare paths (a mix Iceberg persists verbatim in manifests). The fix derives the parent directory with HadoopPath, which preserves scheme + authority.Changes
Bug Fixes
Operations.prepareBackupDataManifestsnow derives a data file's parent via adataFileParent()helper backed by HadoopPathinstead ofjava.nio.file.Paths, preserving scheme + authority for fully-qualifiedhdfs://paths.Tests
OperationsBackupPathTest, a pure-Java (no Spark) regression test covering both fully-qualifiedhdfs://authority/...and bare/data/...data file forms, asserting the authority is preserved and the backup dir is inserted correctly.Testing Done
OperationsBackupPathTest(4 cases) passes on both the Spark 3.1 and 3.5 modules. RevertingdataFileParentto the oldjava.nio.file.Pathsimplementation makes the two authority-bearing cases fail (hdfs://ltx1-holdem/...→hdfs:/ltx1-holdem/...), confirming the tests catch the regression; the bare-path cases continue to pass. (Note: the in-JVM test harness uses a localfile:///filesystem with no authority, so thehdfs://authority drop cannot be reproduced through the Spark integration path without a MiniDFSCluster + HDFS-backed storage; the pure-Java test pins the path-derivation behavior deterministically instead.)