Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AE5389E33 for ; Wed, 28 Dec 2011 10:06:07 +0000 (UTC) Received: (qmail 26612 invoked by uid 500); 28 Dec 2011 10:06:07 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 26563 invoked by uid 500); 28 Dec 2011 10:06:06 -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 26556 invoked by uid 99); 28 Dec 2011 10:06:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Dec 2011 10:06:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Dec 2011 10:06:04 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 92EA023888E7 for ; Wed, 28 Dec 2011 10:05:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1225152 - in /hbase/branches/0.92: CHANGES.txt src/main/java/org/apache/hadoop/hbase/io/Reference.java src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java Date: Wed, 28 Dec 2011 10:05:42 -0000 To: commits@hbase.apache.org From: tedyu@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111228100542.92EA023888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tedyu Date: Wed Dec 28 10:05:42 2011 New Revision: 1225152 URL: http://svn.apache.org/viewvc?rev=1225152&view=rev Log: HBASE-5009 Failure of creating split dir if it already exists prevents splits from happening further Modified: hbase/branches/0.92/CHANGES.txt hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/io/Reference.java hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java Modified: hbase/branches/0.92/CHANGES.txt URL: http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1225152&r1=1225151&r2=1225152&view=diff ============================================================================== --- hbase/branches/0.92/CHANGES.txt (original) +++ hbase/branches/0.92/CHANGES.txt Wed Dec 28 10:05:42 2011 @@ -899,6 +899,7 @@ Release 0.90.6 - Unreleased BUG FIXES HBASE-4970 Add a parameter so that keepAliveTime of Htable thread pool can be changed (gaojinchao) HBASE-5060 HBase client is blocked forever (Jinchao) + HBASE-5009 Failure of creating split dir if it already exists prevents splits from happening further Release 0.90.5 - Unreleased Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/io/Reference.java URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/io/Reference.java?rev=1225152&r1=1225151&r2=1225152&view=diff ============================================================================== --- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/io/Reference.java (original) +++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/io/Reference.java Wed Dec 28 10:05:42 2011 @@ -125,8 +125,7 @@ public class Reference implements Writab public Path write(final FileSystem fs, final Path p) throws IOException { - FSUtils.create(fs, p); - FSDataOutputStream out = fs.create(p); + FSDataOutputStream out = fs.create(p, false); try { write(out); } finally { @@ -153,4 +152,4 @@ public class Reference implements Writab in.close(); } } -} \ No newline at end of file +} Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java?rev=1225152&r1=1225151&r2=1225152&view=diff ============================================================================== --- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java (original) +++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java Wed Dec 28 10:05:42 2011 @@ -529,7 +529,14 @@ public class SplitTransaction { */ private static void createSplitDir(final FileSystem fs, final Path splitdir) throws IOException { - if (fs.exists(splitdir)) throw new IOException("Splitdir already exits? " + splitdir); + if (fs.exists(splitdir)) { + LOG.info("The " + splitdir + + " directory exists. Hence deleting it to recreate it"); + if (!fs.delete(splitdir, true)) { + throw new IOException("Failed deletion of " + splitdir + + " before creating them again."); + } + } if (!fs.mkdirs(splitdir)) throw new IOException("Failed create of " + splitdir); } @@ -589,6 +596,10 @@ public class SplitTransaction { this.fileSplitTimeout, TimeUnit.MILLISECONDS); if (stillRunning) { threadPool.shutdownNow(); + // wait for the thread to shutdown completely. + while (!threadPool.isTerminated()) { + Thread.sleep(50); + } throw new IOException("Took too long to split the" + " files and create the references, aborting split"); }