Repository navigation
HBASE-30517: Non-COMPLETE backups can be used in Point-In-Time Restore with a custom backup location - #8835
HBASE-30517: Non-COMPLETE backups can be used in Point-In-Time Restore with a custom backup location#8835kgeisz wants to merge 2 commits into
Conversation
|
PR Review by ChatGPT 5.6 Sol Review SummaryThe PR addresses a valid correctness issue: incomplete backups must not be selected for Point-in-Time Restore (PITR). However, I have two concerns with the proposed implementation, including a potential regression in custom backup location support. 1. [Blocking] Custom backup locations now depend on the current cluster's BackupSystemTable
Previously, the custom-location handler discovered backup images directly from filesystem manifests. With this change, each image must also have a corresponding This introduces a dependency that may break an important use case:
The backup manifest is designed to preserve the metadata needed for restoration, including support for relocated backups. Requiring the current cluster's system table to contain the original backup record appears inconsistent with this design. Recommendation: Preserve filesystem-based backup discovery without introducing a mandatory dependency on the current cluster's Ideally, backup completeness should be verifiable from filesystem metadata, perhaps through an explicit completion marker written only after successful backup finalization. If this requires a larger change, we should at least clarify the intended compatibility guarantees and add a regression test covering backups created on another cluster or moved to a different location. 2. [Major] IOException must not be silently interpreted as an incomplete backup
The current implementation catches This conflates three different conditions:
A temporary I/O failure could silently exclude otherwise valid backup images, potentially producing misleading PITR errors. Recommendation: Propagate Since the stream predicate cannot directly throw a checked exception, replacing the stream with a conventional loop would simplify the implementation. 3. [Major] Missing compatibility regression tests
The new tests cover filtering by backup state, missing metadata entries, and I/O failures. However, they primarily validate the newly introduced behavior rather than preserving existing functionality. In particular, the test asserting that an image with no corresponding Recommendation: Add a test verifying that a complete backup discovered through a custom filesystem location remains usable when the current cluster does not have its original system-table metadata, provided the required PITR metadata and WALs are available. 4. [Minor] Repeated system-table lookupsThe handler performs a separate For a location containing many images, this results in N individual metadata lookups. If the system-table dependency is retained, consider retrieving the relevant backup history in a batch and filtering against an in-memory map. This is a minor optimization and not a merge blocker. ConclusionI agree with the objective of preventing incomplete backups from being selected for PITR. However, the implementation introduces a potentially breaking dependency between custom-location restoration and the current cluster's system-table metadata. I recommend addressing the custom-location compatibility issue and IOException handling before merging. The central architectural question is whether a backup stored in an external filesystem location should remain independently restorable without requiring its original |
…e with a custom backup location Change-Id: I22290330a3811e4e63744fc43e3016f29f447a56
Change-Id: I9f9f29a8a767be0623ef134adcbb09cdfe85ecfa
4d1b956 to
c225b44
Compare
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the custom-location restore metadata filtering change.
No open issues 🎉
What changed in this PR
Addresses HBASE-30517 by filtering custom-location point-in-time restore metadata using backup completion markers, without relying on the current cluster’s backup system table.
Changes:
- Excludes custom-location backups without completion markers and propagates marker-check I/O errors.
- Adds metadata-retrieval logging to both restore handlers.
- Adds shared filtering tests and custom-location tests covering filesystem markers, error propagation, and system-table independence.
| File | Description |
|---|---|
hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/impl/TestDefaultPitrRestoreHandler.java |
Tests completion-state filtering in the default handler. |
hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/impl/TestCustomBackupLocationPitrRestoreHandler.java |
Tests marker filtering, I/O errors, system-table independence, and on-disk markers. |
hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/impl/TestAbstractPitrRestoreHandlerGetBackupMetadata.java |
Provides shared fixtures and completion-filtering tests for both handlers. |
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/DefaultPitrRestoreHandler.java |
Logs metadata retrieval; retains existing completion-state filtering. |
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/CustomBackupLocationPitrRestoreHandler.java |
Filters backups by completion marker and logs retrieval and skipped backups. |
Review effort: Balanced
https://issues.apache.org/jira/browse/HBASE-30517
AI Usage
Code changes assisted by Claude Opus 4.6.
Summary
The
AbstractPitrRestoreHandlerclass has two implementations -DefaultPitrRestoreHandlerandCustomBackupLocationPitrRestoreHandler. Both of these classes implement thegetBackupMetadata()method. TheDefaultPitrRestoreHandlerclass correctly filters out backups that don't have aCOMPLETEstate. However,CustomBackupLocationPitrRestoreHandler's implementation of this method does not do this.The changes in this PR ensure only
COMPLETEbackups are used when performing a Point-In-Time Restore on backups with a custom backup location.