Skip to content

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 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

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.


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

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 ?


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

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 overall. I just have one comment.

Comment on lines +283 to +284
throw new IOException("Bulk load operation detected after last successful backup for "
+ "table: " + sTableName);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think this error message should be a little more descriptive? It is saying why there is an error, but it doesn't necessarily tell the user what they should be doing instead to prevent this error.

My understanding is the user is supposed to perform a full or incremental backup after doing a bulkload. To me, this function is detecting that a bulkload has occurred since the last backup, and it is correctly throwing an error. However, the message isn't telling the user they should do another backup after bulkloading in order to get around this error.

@taklwu
Copy link
Contributor

taklwu commented Jul 22, 2025

let's wait till the tests complete and then we can merge

@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

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

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.

nit: there is a used variable found by the javac check

@Apache-HBase

This comment has been minimized.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 34s 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 10s Maven dependency ordering for branch
+1 💚 mvninstall 3m 18s HBASE-28957 passed
+1 💚 compile 4m 22s HBASE-28957 passed
-0 ⚠️ checkstyle 0m 10s /buildtool-branch-checkstyle-hbase-backup.txt The patch fails to run checkstyle in hbase-backup
+1 💚 spotbugs 4m 29s HBASE-28957 passed
+1 💚 spotless 0m 48s branch has no errors when running spotless:check.
-0 ⚠️ patch 1m 8s 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 12s Maven dependency ordering for patch
+1 💚 mvninstall 3m 6s the patch passed
+1 💚 compile 4m 21s the patch passed
+1 💚 cc 4m 21s the patch passed
+1 💚 javac 0m 37s hbase-protocol-shaded in the patch passed.
+1 💚 javac 3m 12s hbase-server in the patch passed.
+1 💚 javac 0m 32s hbase-backup generated 0 new + 117 unchanged - 1 fixed = 117 total (was 118)
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 9s /buildtool-patch-checkstyle-hbase-backup.txt The patch fails to run checkstyle in hbase-backup
+1 💚 spotbugs 4m 52s the patch passed
+1 💚 hadoopcheck 12m 17s Patch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚 hbaseprotoc 1m 37s the patch passed
+1 💚 spotless 0m 45s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 27s The patch does not generate ASF License warnings.
51m 28s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7150/11/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 d71e27de5eee 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 / 694511b
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/11/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 37s 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 34s Maven dependency ordering for branch
+1 💚 mvninstall 3m 12s HBASE-28957 passed
+1 💚 compile 1m 49s HBASE-28957 passed
+1 💚 javadoc 0m 51s HBASE-28957 passed
+1 💚 shadedjars 6m 1s branch has no errors when building our shaded downstream artifacts.
-0 ⚠️ patch 6m 26s 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 13s Maven dependency ordering for patch
+1 💚 mvninstall 3m 3s the patch passed
+1 💚 compile 1m 49s the patch passed
+1 💚 javac 1m 49s the patch passed
+1 💚 javadoc 0m 49s the patch passed
+1 💚 shadedjars 5m 57s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 0m 35s hbase-protocol-shaded in the patch passed.
-1 ❌ unit 232m 50s /patch-unit-hbase-server.txt hbase-server in the patch failed.
-1 ❌ unit 24m 51s /patch-unit-hbase-backup.txt hbase-backup in the patch failed.
288m 51s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7150/11/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7150
Optional Tests javac javadoc unit compile shadedjars
uname Linux 59cbeba0001b 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 / 694511b
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7150/11/testReport/
Max. process+thread count 5203 (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/11/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.

@taklwu taklwu merged commit b2f2c2f into apache:HBASE-28957 Jul 23, 2025
1 check failed
anmolnar pushed a commit that referenced this pull request Jul 28, 2025
Signed-off-by: Tak Lon (Stephen) Wu <taklwu@apache.org>
Reviewed by: Kevin Geiszler <kevin.j.geiszler@gmail.com>
vinayakphegde pushed a commit to vinayakphegde/hbase that referenced this pull request Jul 29, 2025
…7150)

Signed-off-by: Tak Lon (Stephen) Wu <taklwu@apache.org>
Reviewed by: Kevin Geiszler <kevin.j.geiszler@gmail.com>
vinayakphegde pushed a commit to vinayakphegde/hbase that referenced this pull request Jul 29, 2025
…7150)

Signed-off-by: Tak Lon (Stephen) Wu <taklwu@apache.org>
Reviewed by: Kevin Geiszler <kevin.j.geiszler@gmail.com>
anmolnar added a commit to anmolnar/hbase that referenced this pull request Sep 10, 2025
anmolnar added a commit to anmolnar/hbase that referenced this pull request Sep 10, 2025
anmolnar pushed a commit that referenced this pull request Sep 11, 2025
Signed-off-by: Tak Lon (Stephen) Wu <taklwu@apache.org>
Reviewed by: Kevin Geiszler <kevin.j.geiszler@gmail.com>
anmolnar added a commit to anmolnar/hbase that referenced this pull request Sep 11, 2025
anmolnar added a commit that referenced this pull request Sep 11, 2025
anmolnar pushed a commit that referenced this pull request Nov 6, 2025
Signed-off-by: Tak Lon (Stephen) Wu <taklwu@apache.org>
Reviewed by: Kevin Geiszler <kevin.j.geiszler@gmail.com>
anmolnar added a commit that referenced this pull request Nov 6, 2025
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