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-15 10:33:54 +08:00 committed by tedyu
parent aa7c93c659
commit 862a717e37
1 changed files with 7 additions and 1 deletions

View File

@ -226,7 +226,13 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService
}
}
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.");
done.run(CleanupBulkLoadResponse.newBuilder().build());
} catch (IOException e) {
ResponseConverter.setControllerException(controller, e);