diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index 0a0fdf4..1049c69 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -2613,14 +2613,14 @@ public class HMaster extends HRegionServer implements MasterServices { } @Override - public Pair backupTables(final BackupType type, + public Pair backupTables(BackupType type, List tableList, final String targetRootDir, final int workers, final long bandwidth) throws IOException { long procId; String backupId = BackupRestoreConstants.BACKUPID_PREFIX + EnvironmentEdgeManager.currentTime(); + Set incrTableSet = null; if (type == BackupType.INCREMENTAL) { - Set incrTableSet = null; try (BackupSystemTable table = new BackupSystemTable(getConnection())) { incrTableSet = table.getIncrementalBackupTableSet(targetRootDir); } @@ -2633,6 +2633,13 @@ public class HMaster extends HRegionServer implements MasterServices { } LOG.info("Incremental backup for the following table set: " + incrTableSet); + tableList.removeAll(incrTableSet); + if (!tableList.isEmpty()) { + LOG.warn("Some tables (" + tableList.get(0) + ") hasn't gone through full backup"); + LOG.warn("Changing backup type to Full for " + targetRootDir); + type = BackupType.FULL; + incrTableSet.addAll(tableList); + } tableList = Lists.newArrayList(incrTableSet); } if (tableList != null && !tableList.isEmpty()) {