HBASE-30049 RestoreSnapshotHelper creates StoreFileTracker with wrong…#8013
Open
bjomobo wants to merge 1 commit intoapache:masterfrom
Open
HBASE-30049 RestoreSnapshotHelper creates StoreFileTracker with wrong…#8013bjomobo wants to merge 1 commit intoapache:masterfrom
bjomobo wants to merge 1 commit intoapache:masterfrom
Conversation
.../java/org/apache/hadoop/hbase/master/procedure/TestRestoreSnapshotProcedureFileBasedSFT.java
Outdated
Show resolved
Hide resolved
.../java/org/apache/hadoop/hbase/master/procedure/TestRestoreSnapshotProcedureFileBasedSFT.java
Show resolved
Hide resolved
e3e3c55 to
6af91ac
Compare
… config causing no-op filelist updates RestoreSnapshotHelper.restoreRegion() creates a StoreFileTracker using the raw Master Configuration object, which does not contain table-level settings like hbase.store.file-tracker.impl=FILE. This causes DefaultStoreFileTracker to be instantiated, whose doSetStoreFiles() is a complete no-op. The .filelist is never updated after the restore moves HFiles to the archive and creates link files for the snapshot's HFiles. When a region subsequently opens, the stale .filelist references HFiles that were moved to the archive, resulting in FileNotFoundException and the region getting stuck in OPENING state indefinitely. This is a regression introduced by HBASE-28564, which refactored reference file creation to go through the StoreFileTracker interface. The cloneRegion() method in the same commit correctly merges the table descriptor config via StoreUtils.createStoreConfiguration() before creating the tracker, but restoreRegion() was missed. The fix applies the same pattern: merge the table descriptor and column family descriptor configuration into the Configuration object before passing it to StoreFileTrackerFactory.create(). This ensures the correct StoreFileTracker implementation is resolved based on the table-level setting. Both locations in restoreRegion() are fixed: 1. For existing families already on disk 2. For new families added from the snapshot
6af91ac to
282757c
Compare
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.
Description
RestoreSnapshotHelper.restoreRegion() creates a StoreFileTracker using the raw Master conf which lacks table-level settings like
hbase.store.file-tracker.impl=FILE. This causes DefaultStoreFileTracker to be used, whosedoSetStoreFiles()is a no-op. The.filelistis never updated after restore, leading toFileNotFoundExceptionwhen regions try to open files that were archived.Regression introduced by HBASE-28564.
Changes
StoreUtils.createStoreConfiguration()before creating the tracker inrestoreRegion()snapshotFamilyFiles != nullcheck to avoidNullPointerExceptionon families being removedwithColumnFamilyDescriptor()to the "Add families not present in the table" code pathNew Tests
TestRestoreSnapshotProcedureFileBasedSFT— end-to-end restore with FILE trackerTestRestoreSnapshotHelperWithFileBasedSFT— unit-level.filelistverificationTestRestoreSnapshotFileTrackerTableLevel— table-level FILE tracker with compaction and multi-family restoreJira: https://issues.apache.org/jira/browse/HBASE-30049