Skip to content

HBASE-29310 Handle Bulk Load Operations in Continuous Backup #7150

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

Open
wants to merge 6 commits into
base: HBASE-28957
Choose a base branch
from

Conversation

ankitsol
Copy link

@ankitsol ankitsol commented Jul 10, 2025

This PR addresses these 2 improvements:

Logging Suggestion during successful bulkload operation:
After a bulk load operation completes, log a message suggesting the user perform a full or incremental backup.

PITR Enhancements:
During PITR, check if any bulk load operation occurred after the last successful backup.
If no such backup exists, inform the user and fail the process.

JIRA: https://issues.apache.org/jira/browse/HBASE-29310

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@taklwu taklwu requested a review from Copilot July 11, 2025 18:07
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances bulk load tooling and point-in-time restore (PITR) to handle bulk-load operations in continuous backup workflows.

  • Adds a post-bulkload suggestion to take a backup
  • Extends PITR validation to detect bulk-loaded files since the last backup and adds a --force option
  • Updates model and storage of bulk-load timestamps and adapts tests and CLI to support the new flow

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
BulkLoadHFilesTool.java Prints a suggestion to back up after successful bulk load
TestPointInTimeRestore.java Exposed overloaded buildPITRArgs with force flag and added force restore tests
TestIncrementalBackupWithContinuous.java Made test counters dynamic, updated performBulkLoad and loadTable signatures
BulkLoad.java Introduced timestamp field and getter
BackupSystemTable.java Captured cell timestamp and passed it into the BulkLoad constructor
BackupAdminImpl.java Propagated isForce through PITR validation, added checkBulkLoadAfterBackup
PointInTimeRestoreRequest.java Added force parameter to the request model
PointInTimeRestoreDriver.java Parsed -f/--force CLI flag and wired it into the request builder
BackupRestoreConstants.java Defined constants for the force-restore option
Comments suppressed due to low confidence (1)

hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupAdminImpl.java:633

  • The Javadoc for validatePitr does not mention the new isForce parameter. Please update the method’s Javadoc to describe this argument.
  private void validatePitr(long endTime, TableName[] sTableArray, TableName[] tTableArray,

Comment on lines +1199 to +1200
System.out.println("Bulk load completed successfully.");
System.out.println("IMPORTANT: Please take a backup of the table immediately if this table "
Copy link
Preview

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

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

Use the framework’s logger (e.g., LOG.info) instead of System.out.println for consistency with the rest of HBase’s logging.

Suggested change
System.out.println("Bulk load completed successfully.");
System.out.println("IMPORTANT: Please take a backup of the table immediately if this table "
LOG.info("Bulk load completed successfully.");
LOG.info("IMPORTANT: Please take a backup of the table immediately if this table "

Copilot uses AI. Check for mistakes.

Copy link
Contributor

Choose a reason for hiding this comment

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

this is not related, you can ignore it.

@@ -69,6 +72,12 @@ protected int executeRestore(boolean check, TableName[] fromTables, TableName[]
return -1;
}

boolean force = cmd.hasOption(OPTION_FORCE_RESTORE);
if (force) {
LOG.debug("Found force option (-{}) in restore command, "
Copy link
Preview

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

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

[nitpick] This debug-level message may not be visible in default logs; consider logging at INFO or printing a user-facing warning so users know they’ve forced a restore.

Suggested change
LOG.debug("Found force option (-{}) in restore command, "
LOG.info("Found force option (-{}) in restore command, "

Copilot uses AI. Check for mistakes.

Copy link
Contributor

Choose a reason for hiding this comment

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

or maybe WARN level?

Copy link
Contributor

@taklwu taklwu left a comment

Choose a reason for hiding this comment

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

LGTM, please explain to us why we would like the force option to be implemented.

Comment on lines 119 to 121
String OPTION_FORCE_RESTORE = "f";
String LONG_OPTION_FORCE_RESTORE = "force";
String OPTION_FORCE_RESTORE_DESC =
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can you explain why should we support this use case if missing backup could cause data loss ?

@@ -69,6 +72,12 @@ protected int executeRestore(boolean check, TableName[] fromTables, TableName[]
return -1;
}

boolean force = cmd.hasOption(OPTION_FORCE_RESTORE);
if (force) {
LOG.debug("Found force option (-{}) in restore command, "
Copy link
Contributor

Choose a reason for hiding this comment

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

or maybe WARN level?

Comment on lines +1199 to +1200
System.out.println("Bulk load completed successfully.");
System.out.println("IMPORTANT: Please take a backup of the table immediately if this table "
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not related, you can ignore it.

@taklwu
Copy link
Contributor

taklwu commented Jul 11, 2025

also, please try to fix the checkstyle and javac if possible.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

Copy link
Contributor

@kgeisz kgeisz left a comment

Choose a reason for hiding this comment

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

LGTM, as long as we're okay with the user being able to perform a backup without performing a bulk load first.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 43s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 buf 0m 0s buf was not available.
+0 🆗 buf 0m 0s 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 12s Maven dependency ordering for branch
+1 💚 mvninstall 4m 9s HBASE-28957 passed
+1 💚 compile 5m 22s HBASE-28957 passed
-0 ⚠️ checkstyle 0m 14s /buildtool-branch-checkstyle-hbase-backup.txt The patch fails to run checkstyle in hbase-backup
+1 💚 spotbugs 5m 20s HBASE-28957 passed
+1 💚 spotless 0m 58s branch has no errors when running spotless:check.
-0 ⚠️ patch 1m 17s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for patch
+1 💚 mvninstall 4m 1s the patch passed
+1 💚 compile 5m 18s the patch passed
+1 💚 cc 5m 18s the patch passed
-0 ⚠️ javac 0m 39s /results-compile-javac-hbase-backup.txt hbase-backup generated 1 new + 118 unchanged - 0 fixed = 119 total (was 118)
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 11s /buildtool-patch-checkstyle-hbase-backup.txt The patch fails to run checkstyle in hbase-backup
+1 💚 spotbugs 6m 9s the patch passed
+1 💚 hadoopcheck 15m 26s Patch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚 hbaseprotoc 2m 18s the patch passed
+1 💚 spotless 1m 4s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 37s The patch does not generate ASF License warnings.
63m 49s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7150/7/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7150
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless cc buflint bufcompat hbaseprotoc
uname Linux dd9842def75e 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 / 1796c61
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 85 (vs. ulimit of 30000)
modules C: hbase-protocol-shaded hbase-server hbase-backup U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7150/7/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.

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.

5 participants