-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBASE-29025: Enhance the full backup command to support Continuous Backup #6710
base: HBASE-28957
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. Just an idea.
if (continuousBackup && !BackupType.FULL.equals(backupType)) { | ||
System.out.println("ERROR: Continuous backup can Only be specified for Full Backup"); | ||
printUsage(); | ||
throw new IOException(INCORRECT_USAGE); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just wondering, since continuous backup is meaningful only for full backups, what if we introduce a new backup type? Maybe we already discussed this, I can't remember.
Usage: hbase backup create <type> <backup_path> [options]
type "full" to create a full backup image
"incremental" to create an incremental backup image
"continuous" to create new continuous backup
backup_path Full path to store the backup image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we discussed this and agreed to go with a new flag for the full backup.
- A continuous backup just takes a full backup and starts the WAL replication process. This happens only once—after that, we only need to take full backups. So, I don’t see a need for a separate backup type.
- Also, introducing a new type would unnecessarily differentiate full and continuous backups.
- In the future, we want to phase out the old incremental backup implementation. The plan is to use WALs replicated through continuous backup for incremental backups. So eventually, we might just have FULL and INCREMENTAL backups, where incremental backups rely on continuously replicated WALs.
- From a code perspective, our backup code has a lot of(almost everywhere) if-else checks for backup types. Adding a new type would mean modifying all of them.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'm convinced let's go with this. I didn't remember the discussion.
if (backupInfo.isContinuousBackupEnabled()) { | ||
handleContinuousBackup(admin); | ||
} else { | ||
handleNonContinuousBackup(admin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we introduced new backup type for continuous backup, you would be able to create a brand new class just for the continuous backup potententially sharing some code if needed.
This if-else branch is a code smell I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise code refactoring looks good to me.
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
This PR introduces a new parameter/option
-cb
(--continuous-backup-enabled
) for full backups. When specified, it enables continuous backup for the selected tables along with the full backup.Continuous backup leverages the HBase replication framework and uses
org.apache.hadoop.hbase.backup.replication.ContinuousBackupReplicationEndpoint
(by default) to continuously stream WAL entries to the backup WAL directory defined byhbase.backup.continuous.wal.dir
.