bbeaudreault commented on code in PR #5782:
URL: https://github.com/apache/hbase/pull/5782#discussion_r1546666809
##########
hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestFullRestore.java:
##########
@@ -71,6 +72,44 @@ public void testFullRestoreSingle() throws Exception {
hba.close();
}
+ @Test
+ public void testFullRestoreSingleWithRegion() throws Exception {
+ LOG.info("test full restore on a single table empty table that has a
region");
+
+ // This test creates its own table so other tests are not affected (we
adjust it in this test)
+ TableName tableName =
TableName.valueOf("table-full-restore-single-region");
+ TEST_UTIL.createTable(tableName, famName);
+
+ Admin admin = TEST_UTIL.getAdmin();
+
+ // Add & remove data to ensure a region is active, but functionally empty
+ Table table = TEST_UTIL.getConnection().getTable(tableName);
+ loadTable(table);
+ admin.flush(tableName);
+ TEST_UTIL.deleteTableData(tableName);
+ admin.flush(tableName);
+
+ admin.majorCompact(tableName);
+ Thread.sleep(5_000);
Review Comment:
This could end up being flaky if the compaction doesn't finish within 5s. It
might be better to use TEST_UTIL.compact which blocks
##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/mapreduce/MapReduceRestoreJob.java:
##########
@@ -87,10 +87,7 @@ public void run(Path[] dirPaths, TableName[] tableNames,
Path restoreRootDir,
LOG.debug("Restoring HFiles from directory " + bulkOutputPath);
}
- if (loader.bulkLoad(newTableNames[i], bulkOutputPath).isEmpty()) {
- throw new IOException("Can not restore from backup directory " +
dirs
- + " (check Hadoop and HBase logs). Bulk loader returns null");
- }
+ loader.bulkLoad(newTableNames[i], bulkOutputPath);
Review Comment:
Is this a safe change? It solves for 1 case where empty hfiles could fail
the restore, but I wonder if there are other cases where the bulkload might
unexpectedly not restore any files.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]