This is an automated email from the ASF dual-hosted git repository.

anmolnar pushed a commit to branch HBASE-28957
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit a903c5992a7e7ba157704287bf5f1aa4bcdd56cc
Author: Kevin Geiszler <[email protected]>
AuthorDate: Fri Jan 23 10:46:21 2026 -0800

    HBASE-29826: Backup merge is failing because .backup.manifest cannot be 
found (#7664)
    
    Signed-off-by: Tak Lon (Stephen) Wu <[email protected]>
---
 .../hbase/backup/impl/IncrementalTableBackupClient.java    | 14 +++++++++-----
 .../hbase/backup/TestIncrementalBackupWithContinuous.java  | 10 +++++++++-
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git 
a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.java
 
b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.java
index 58fabfb557c..59418c86b81 100644
--- 
a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.java
+++ 
b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.java
@@ -103,7 +103,7 @@ public class IncrementalTableBackupClient extends 
TableBackupClient {
   }
 
   /**
-   * Check if a given path is belongs to active WAL directory
+   * Check if a given path belongs to active WAL directory
    * @param p path
    * @return true, if yes
    */
@@ -126,9 +126,9 @@ public class IncrementalTableBackupClient extends 
TableBackupClient {
 
   /**
    * Reads bulk load records from backup table, iterates through the records 
and forms the paths for
-   * bulk loaded hfiles. Copies the bulk loaded hfiles to backup destination. 
This method does NOT
-   * clean up the entries in the bulk load system table. Those entries should 
not be cleaned until
-   * the backup is marked as complete.
+   * bulk loaded hfiles. Copies the bulk loaded hfiles to the backup 
destination. This method does
+   * NOT clean up the entries in the bulk load system table. Those entries 
should not be cleaned
+   * until the backup is marked as complete.
    * @param tablesToBackup list of tables to be backed up
    */
   protected List<BulkLoad> handleBulkLoad(List<TableName> tablesToBackup,
@@ -404,13 +404,17 @@ public class IncrementalTableBackupClient extends 
TableBackupClient {
       failBackup(conn, backupInfo, backupManager, e, "Unexpected Exception : ",
         BackupType.INCREMENTAL, conf);
       throw new IOException(e);
+    } finally {
+      if (backupInfo.isContinuousBackupEnabled()) {
+        deleteBulkLoadDirectory();
+      }
     }
   }
 
   protected void incrementalCopyHFiles(String[] files, String backupDest) 
throws IOException {
     boolean diskBasedSortingOriginalValue = 
HFileOutputFormat2.diskBasedSortingEnabled(conf);
     try {
-      LOG.debug("Incremental copy HFiles is starting. dest=" + backupDest);
+      LOG.debug("Incremental copy HFiles is starting. dest={}", backupDest);
       // set overall backup phase: incremental_copy
       backupInfo.setPhase(BackupPhase.INCREMENTAL_COPY);
       // get incremental backup file list and prepare parms for DistCp
diff --git 
a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestIncrementalBackupWithContinuous.java
 
b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestIncrementalBackupWithContinuous.java
index 72867da95f1..c911f5dbce0 100644
--- 
a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestIncrementalBackupWithContinuous.java
+++ 
b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestIncrementalBackupWithContinuous.java
@@ -70,19 +70,21 @@ public class TestIncrementalBackupWithContinuous extends 
TestBackupBase {
   private static final int ROWS_IN_BULK_LOAD = 100;
   private static final String backupWalDirName = "TestContinuousBackupWalDir";
 
+  private FileSystem fs;
+
   @Before
   public void beforeTest() throws IOException {
     Path root = TEST_UTIL.getDataTestDirOnTestFS();
     Path backupWalDir = new Path(root, backupWalDirName);
     conf1.set(CONF_CONTINUOUS_BACKUP_WAL_DIR, backupWalDir.toString());
     conf1.setBoolean(REPLICATION_MARKER_ENABLED_KEY, true);
+    fs = FileSystem.get(conf1);
   }
 
   @After
   public void afterTest() throws IOException {
     Path root = TEST_UTIL.getDataTestDirOnTestFS();
     Path backupWalDir = new Path(root, backupWalDirName);
-    FileSystem fs = FileSystem.get(conf1);
     if (fs.exists(backupWalDir)) {
       fs.delete(backupWalDir, true);
     }
@@ -126,6 +128,12 @@ public class TestIncrementalBackupWithContinuous extends 
TestBackupBase {
       assertTrue(checkSucceeded(backup2));
       LOG.info("Incremental backup completed");
 
+      // Verify the temporary backup directory was deleted
+      Path backupTmpDir = new Path(BACKUP_ROOT_DIR, ".tmp");
+      Path bulkLoadOutputDir = new Path(backupTmpDir, backup2);
+      assertFalse("Bulk load output directory " + bulkLoadOutputDir + " should 
have been deleted",
+        fs.exists(bulkLoadOutputDir));
+
       // Verify backup history increased and all the backups are succeeded
       backups = table.getBackupHistory();
       assertEquals("Backup history should increase", before + 1, 
backups.size());

Reply via email to