hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-18801 Bulk load cleanup may falsely deem file deletion successful
Date Fri, 15 Sep 2017 09:15:16 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 aa7c93c65 -> 862a717e3


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

Signed-off-by: tedyu <yuzhihong@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/862a717e
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/862a717e
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/862a717e

Branch: refs/heads/branch-1
Commit: 862a717e37ddfeaf15661b567098541abd616587
Parents: aa7c93c
Author: Reid Chan <reidddchan@outlook.com>
Authored: Fri Sep 15 10:33:54 2017 +0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Fri Sep 15 02:15:06 2017 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/security/access/SecureBulkLoadEndpoint.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/862a717e/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java
----------------------------------------------------------------------
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 9670684..37d66e5 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);


Mime
View raw message