Skip to content

Conversation

@vinayakphegde
Copy link
Contributor

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 by hbase.backup.continuous.wal.dir.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

Copy link
Contributor

@anmolnar anmolnar left a 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.

Comment on lines +350 to +354
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);
}
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Comment on lines +152 to +155
if (backupInfo.isContinuousBackupEnabled()) {
handleContinuousBackup(admin);
} else {
handleNonContinuousBackup(admin);
Copy link
Contributor

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.

Copy link
Contributor

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.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

this.continuousBackupEnabled = continuousBackupEnabled;
}

public boolean getContinuousBackupEnabled() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: if the return type is boolean the method name should be isContinousBackupEnabled

String OPTION_ENABLE_CONTINUOUS_BACKUP = "cb";
String LONG_OPTION_ENABLE_CONTINUOUS_BACKUP = "continuous-backup-enabled";
String OPTION_ENABLE_CONTINUOUS_BACKUP_DESC =
"Flag indicating that the full backup " + "is part of a continuous backup process.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: why + in between?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll remove that

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 36s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+0 🆗 buf 0m 1s buf was not available.
+0 🆗 buf 0m 1s buf was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ HBASE-28957 Compile Tests _
+0 🆗 mvndep 0m 9s Maven dependency ordering for branch
+1 💚 mvninstall 3m 7s HBASE-28957 passed
+1 💚 compile 1m 8s HBASE-28957 passed
+1 💚 checkstyle 0m 17s HBASE-28957 passed
+1 💚 spotbugs 2m 42s HBASE-28957 passed
+1 💚 spotless 0m 44s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for patch
+1 💚 mvninstall 2m 58s the patch passed
+1 💚 compile 1m 3s the patch passed
+1 💚 cc 1m 3s the patch passed
+1 💚 javac 1m 3s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 10s /results-checkstyle-hbase-backup.txt hbase-backup: The patch generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
+1 💚 spotbugs 2m 56s the patch passed
+1 💚 hadoopcheck 11m 31s Patch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚 hbaseprotoc 1m 2s the patch passed
+1 💚 spotless 0m 43s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 16s The patch does not generate ASF License warnings.
37m 6s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6710/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #6710
JIRA Issue HBASE-29025
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless cc buflint bufcompat hbaseprotoc
uname Linux 8f7d981df43f 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision HBASE-28957 / f04b223
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 85 (vs. ulimit of 30000)
modules C: hbase-protocol-shaded hbase-backup U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6710/3/console
versions git=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 30s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ HBASE-28957 Compile Tests _
+0 🆗 mvndep 0m 32s Maven dependency ordering for branch
+1 💚 mvninstall 3m 24s HBASE-28957 passed
+1 💚 compile 0m 52s HBASE-28957 passed
+1 💚 javadoc 0m 25s HBASE-28957 passed
+1 💚 shadedjars 5m 53s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 12s Maven dependency ordering for patch
+1 💚 mvninstall 2m 58s the patch passed
+1 💚 compile 0m 50s the patch passed
+1 💚 javac 0m 50s the patch passed
+1 💚 javadoc 0m 21s the patch passed
+1 💚 shadedjars 5m 49s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 0m 32s hbase-protocol-shaded in the patch passed.
+1 💚 unit 19m 12s hbase-backup in the patch passed.
42m 35s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6710/3/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #6710
JIRA Issue HBASE-29025
Optional Tests javac javadoc unit compile shadedjars
uname Linux a4ff076a488b 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision HBASE-28957 / f04b223
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6710/3/testReport/
Max. process+thread count 3278 (vs. ulimit of 30000)
modules C: hbase-protocol-shaded hbase-backup U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6710/3/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@abhradeepkundu abhradeepkundu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@anmolnar anmolnar merged commit fcee6f7 into apache:HBASE-28957 Mar 4, 2025
1 check passed
anmolnar pushed a commit that referenced this pull request Mar 25, 2025
…ckup (#6710)

* HBASE-29025: Enhance the full backup command to support continuous backup

* add new check for full backup command regards to continuous backup flag

* minor fixes
anmolnar pushed a commit that referenced this pull request Jul 28, 2025
…ckup (#6710)

* HBASE-29025: Enhance the full backup command to support continuous backup

* add new check for full backup command regards to continuous backup flag

* minor fixes
vinayakphegde added a commit to vinayakphegde/hbase that referenced this pull request Jul 29, 2025
…ckup (apache#6710)

* HBASE-29025: Enhance the full backup command to support continuous backup

* add new check for full backup command regards to continuous backup flag

* minor fixes
vinayakphegde added a commit to vinayakphegde/hbase that referenced this pull request Jul 29, 2025
…ckup (apache#6710)

* HBASE-29025: Enhance the full backup command to support continuous backup

* add new check for full backup command regards to continuous backup flag

* minor fixes
anmolnar pushed a commit that referenced this pull request Sep 11, 2025
…ckup (#6710)

* HBASE-29025: Enhance the full backup command to support continuous backup

* add new check for full backup command regards to continuous backup flag

* minor fixes
anmolnar pushed a commit that referenced this pull request Nov 6, 2025
…ckup (#6710)

* HBASE-29025: Enhance the full backup command to support continuous backup

* add new check for full backup command regards to continuous backup flag

* minor fixes
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.

4 participants