Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2CCED200CE6 for ; Fri, 15 Sep 2017 11:16:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2B6391609D1; Fri, 15 Sep 2017 09:16:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 705D71609CF for ; Fri, 15 Sep 2017 11:16:50 +0200 (CEST) Received: (qmail 70555 invoked by uid 500); 15 Sep 2017 09:16:49 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 70546 invoked by uid 99); 15 Sep 2017 09:16:49 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Sep 2017 09:16:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5EAB6F5546; Fri, 15 Sep 2017 09:16:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tedyu@apache.org To: commits@hbase.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: hbase git commit: HBASE-18801 Bulk load cleanup may falsely deem file deletion successful Date: Fri, 15 Sep 2017 09:16:49 +0000 (UTC) archived-at: Fri, 15 Sep 2017 09:16:51 -0000 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 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 Authored: Fri Sep 15 10:33:54 2017 +0800 Committer: tedyu 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);