diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java index 1b3694425af..d177384cacf 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java @@ -65,6 +65,7 @@ import org.apache.hadoop.hbase.client.SnapshotDescription; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.client.TableDescriptorBuilder; +import org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore; import org.apache.hadoop.hbase.shaded.protobuf.generated.BackupProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos; import org.apache.hadoop.hbase.util.Bytes; @@ -1116,6 +1117,11 @@ public final class BackupSystemTable implements Closeable { List fileStatuses = new ArrayList<>(); for (FileStatus file : files) { + String fn = file.getPath().getName(); + if (fn.startsWith(WALProcedureStore.LOG_PREFIX)) { + ret.put(file, true); + continue; + } String wal = file.getPath().toString(); Get get = createGetForCheckWALFile(wal); getBuffer.add(get); diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalBackupManager.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalBackupManager.java index a20f9b548f5..81652d8ae25 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalBackupManager.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalBackupManager.java @@ -38,6 +38,7 @@ import org.apache.hadoop.hbase.backup.master.LogRollMasterProcedureManager; import org.apache.hadoop.hbase.backup.util.BackupUtils; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Connection; +import org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore; import org.apache.hadoop.hbase.util.FSUtils; import org.apache.hadoop.hbase.wal.AbstractFSWALProvider; import org.apache.yetus.audience.InterfaceAudience; @@ -101,7 +102,7 @@ public class IncrementalBackupManager extends BackupManager { List logFromSystemTable = getLogFilesFromBackupSystem(previousTimestampMins, newTimestamps, getBackupInfo() .getBackupRootDir()); - logList = excludeAlreadyBackedUpWALs(logList, logFromSystemTable); + logList = excludeAlreadyBackedUpAndProcV2WALs(logList, logFromSystemTable); backupInfo.setIncrBackupFileList(logList); return newTimestamps; @@ -144,14 +145,13 @@ public class IncrementalBackupManager extends BackupManager { getLogFilesFromBackupSystem(previousTimestampMins, newTimestamps, getBackupInfo() .getBackupRootDir()); - logList = excludeAlreadyBackedUpWALs(logList, logFromSystemTable); + logList = excludeAlreadyBackedUpAndProcV2WALs(logList, logFromSystemTable); backupInfo.setIncrBackupFileList(logList); return logList; } - - private List excludeAlreadyBackedUpWALs(List logList, + private List excludeAlreadyBackedUpAndProcV2WALs(List logList, List logFromSystemTable) { Set walFileNameSet = convertToSet(logFromSystemTable); @@ -160,7 +160,7 @@ public class IncrementalBackupManager extends BackupManager { Path p = new Path(logList.get(i)); String name = p.getName(); - if (walFileNameSet.contains(name)) { + if (walFileNameSet.contains(name) || name.startsWith(WALProcedureStore.LOG_PREFIX)) { continue; } diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java index 5ce11d19c0d..8d9400fd926 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java @@ -97,7 +97,6 @@ public class BackupLogCleaner extends BaseLogCleanerDelegate { LOG.warn("Backup system table is not available: {}", tnfe.getMessage()); return files; } - List list = new ArrayList<>(); Map walFilesDeletableMap = table.areWALFilesDeletable(files); for (Map.Entry entry: walFilesDeletableMap.entrySet()) {