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:16:49 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.4 ae5da908b -> 55aa7bbc2


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/55aa7bbc
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/55aa7bbc
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/55aa7bbc

Branch: refs/heads/branch-1.4
Commit: 55aa7bbc2cf4a553fbf172ffc1e7846739b3f3c3
Parents: ae5da90
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:16:10 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/55aa7bbc/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