HBASE-18801 Bulk load cleanup may falsely deem file deletion successful

Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
Reid Chan 2017-09-14 20:28:17 +08:00 committed by tedyu
parent 61d10feffa
commit c17b491432
1 changed files with 7 additions and 1 deletions

View File

@ -170,7 +170,13 @@ public class SecureBulkLoadManager {
}
}
fs.delete(new Path(request.getBulkToken()), true);
Path path = new Path(request.getBulkToken());
if (!fs.delete(path, true)) {
if (fs.exists(path)) {
throw new IOException("Failed to clean up " + path);
}
}
LOG.info("Cleaned up " + path + " successfully.");
}
public Map<byte[], List<Path>> secureBulkLoadHFiles(final Region region,