HBASE-29846 Fix backup history ordering#7662
Open
DieterDP-ng wants to merge 1 commit intoapache:masterfrom
Open
HBASE-29846 Fix backup history ordering#7662DieterDP-ng wants to merge 1 commit intoapache:masterfrom
DieterDP-ng wants to merge 1 commit intoapache:masterfrom
Conversation
Restores the ordering of BackupAdmin#getHistory that was accidentally reversed in HBASE-29808. Extends & refactors TestBackupShowHistory to verify correct behavior. Fixes a possible FileNotFoundException in BackupUtils#getHistory. Merges BackupSystemTable#getBackupHistory with BackupSystemTable#getBackupInfos, to further simplify backup info retrieval. Optimized various usages of history retrieval. Clarified some javadoc regarding backup history retrieval.
DieterDP-ng
commented
Jan 22, 2026
| * @param n number of entries to return | ||
| */ | ||
| public List<BackupInfo> getBackupInfos(int n, BackupInfo.Filter... toInclude) throws IOException { | ||
| public List<BackupInfo> getBackupHistory(boolean newToOld, int n, BackupInfo.Filter... toInclude) |
Contributor
Author
There was a problem hiding this comment.
Strictly speaking, because the BackupInfos are stored using BackupIds as key, the ordering promised in this method will break over 261 years, when the epoch 9999999999 becomes 10000000000. This is a side effect of backupIds not being 0-padded when stored.
I.e., the scan would return out-of-order results:
backup_10000000000backup_9999999998backup_9999999999
But I guess that's acceptable.
Contributor
Author
|
@ndimiduk @hgromer, since you reviewed HBASE-29808, you're well suited for this PR too. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
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.
Restores the ordering of BackupAdmin#getHistory that was accidentally reversed in HBASE-29808. Extends & refactors TestBackupShowHistory to verify correct behavior.
Fixes a possible FileNotFoundException in BackupUtils#getHistory.
Merges BackupSystemTable#getBackupHistory with
BackupSystemTable#getBackupInfos, to further simplify backup info retrieval. Optimized various usages of history retrieval.
Clarified some javadoc regarding backup history retrieval.