Skip to content

[WIP] HBASE-29435 Add RestoreSnapshotHFileArchiver to guard against accidental data loss#8248

Draft
SwaraliJoshi wants to merge 1 commit into
apache:masterfrom
SwaraliJoshi:W-22336363-hbase-29435-limit-hfile-actions
Draft

[WIP] HBASE-29435 Add RestoreSnapshotHFileArchiver to guard against accidental data loss#8248
SwaraliJoshi wants to merge 1 commit into
apache:masterfrom
SwaraliJoshi:W-22336363-hbase-29435-limit-hfile-actions

Conversation

@SwaraliJoshi
Copy link
Copy Markdown

Introduce RestoreSnapshotHFileArchiver as a safe wrapper around HFileArchiver for use by RestoreSnapshotHelper. Before delegating any archive/delete operation, it validates that the target path does not fall under the production HBase root directory (hbase.rootdir). If it does, the operation is blocked with an IOException and an ERROR log to prevent accidental data loss.

  • Add RestoreSnapshotHFileArchiver with root-dir safety checks for archiveRegion and archiveFamilyByFamilyDir
  • Update RestoreSnapshotHelper to use RestoreSnapshotHFileArchiver instead of HFileArchiver directly (both call sites)
  • Add TestRestoreSnapshotHFileArchiver with 7 tests covering root-dir blocking, temp-dir allowing, sibling-path handling, and custom root dirs

…tal data loss

Introduce RestoreSnapshotHFileArchiver as a safe wrapper around HFileArchiver
for use by RestoreSnapshotHelper. Before delegating any archive/delete operation,
it validates that the target path does not fall under the production HBase root
directory (hbase.rootdir). If it does, the operation is blocked with an IOException
and an ERROR log to prevent accidental data loss.

- Add RestoreSnapshotHFileArchiver with root-dir safety checks for archiveRegion
  and archiveFamilyByFamilyDir
- Update RestoreSnapshotHelper to use RestoreSnapshotHFileArchiver instead of
  HFileArchiver directly (both call sites)
- Add TestRestoreSnapshotHFileArchiver with 7 tests covering root-dir blocking,
  temp-dir allowing, sibling-path handling, and custom root dirs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@SwaraliJoshi SwaraliJoshi marked this pull request as draft May 18, 2026 06:50
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.

1 participant