From 862a717e37ddfeaf15661b567098541abd616587 Mon Sep 17 00:00:00 2001 From: Reid Chan Date: Fri, 15 Sep 2017 10:33:54 +0800 Subject: [PATCH] HBASE-18801 Bulk load cleanup may falsely deem file deletion successful Signed-off-by: tedyu --- .../hbase/security/access/SecureBulkLoadEndpoint.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java index 9670684927c..37d66e546cf 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java @@ -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);