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 7FA17200CE6 for ; Fri, 15 Sep 2017 11:15:19 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7E4311609D1; Fri, 15 Sep 2017 09:15:19 +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 C4C0B1609CF for ; Fri, 15 Sep 2017 11:15:18 +0200 (CEST) Received: (qmail 62949 invoked by uid 500); 15 Sep 2017 09:15:17 -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 62936 invoked by uid 99); 15 Sep 2017 09:15:17 -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:15:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1EE72F5546; Fri, 15 Sep 2017 09:15:16 +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: <470e1aa7883943799f1fde26e1a86ffe@git.apache.org> 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:15:16 +0000 (UTC) archived-at: Fri, 15 Sep 2017 09:15:19 -0000 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 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 Authored: Fri Sep 15 10:33:54 2017 +0800 Committer: tedyu 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);