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 C66E1200CCA for ; Wed, 19 Jul 2017 08:43:32 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C4DE3168482; Wed, 19 Jul 2017 06:43:32 +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 1994F168479 for ; Wed, 19 Jul 2017 08:43:31 +0200 (CEST) Received: (qmail 7530 invoked by uid 500); 19 Jul 2017 06:43:31 -0000 Mailing-List: contact commits-help@bookkeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: bookkeeper-dev@bookkeeper.apache.org Delivered-To: mailing list commits@bookkeeper.apache.org Received: (qmail 7521 invoked by uid 99); 19 Jul 2017 06:43:31 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jul 2017 06:43:31 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 769F381155; Wed, 19 Jul 2017 06:43:30 +0000 (UTC) Date: Wed, 19 Jul 2017 06:43:30 +0000 To: "commits@bookkeeper.apache.org" Subject: [bookkeeper] branch master updated: ISSUE #256: BookieInitializationTest.testWithDiskFullAndAbilityToCreateNewIndexFile failed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <150044661042.32563.3296986356346232547@gitbox.apache.org> From: eolivelli@apache.org Reply-To: "commits@bookkeeper.apache.org" X-Git-Host: gitbox.apache.org X-Git-Repo: bookkeeper X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 7277657740c276b6f036322177c147264ba5100b X-Git-Newrev: 7e9350cff67f0cb72ab757d500d98044cbdd4264 X-Git-Rev: 7e9350cff67f0cb72ab757d500d98044cbdd4264 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated archived-at: Wed, 19 Jul 2017 06:43:33 -0000 This is an automated email from the ASF dual-hosted git repository. eolivelli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/bookkeeper.git The following commit(s) were added to refs/heads/master by this push: new 7e9350c ISSUE #256: BookieInitializationTest.testWithDiskFullAndAbilityToCreateNewIndexFile failed 7e9350c is described below commit 7e9350cff67f0cb72ab757d500d98044cbdd4264 Author: Sijie Guo AuthorDate: Wed Jul 19 08:43:14 2017 +0200 ISSUE #256: BookieInitializationTest.testWithDiskFullAndAbilityToCreateNewIndexFile failed Descriptions of the changes in this PR: in c49621b, we allow creating FileInfo even when disk is full to allow fence requests succeed at this case. it is conflicted with Charan's change. Since there is already a setting to configure the min usable size to allow index file creation. if we configure that to be zero, it is same as allowing index file creation even disks are full. so removing the fallback logic introduced in c49621b. Author: Sijie Guo Reviewers: Charan Reddy Guttapalem, Enrico Olivelli This closes #257 from sijie/issue_256, closes #256 --- .../bookkeeper/bookie/IndexPersistenceMgr.java | 35 ++-------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexPersistenceMgr.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexPersistenceMgr.java index d8bed79..859e8d7 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexPersistenceMgr.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexPersistenceMgr.java @@ -128,7 +128,7 @@ public class IndexPersistenceMgr { throw new Bookie.NoLedgerException(ledger); } // We don't have a ledger index file on disk, so create it. - lf = getNewLedgerIndexFile(ledger, null, true); + lf = getNewLedgerIndexFile(ledger, null); createdNewFile = true; } } @@ -179,38 +179,7 @@ public class IndexPersistenceMgr { */ private File getNewLedgerIndexFile(Long ledger, File excludedDir) throws NoWritableLedgerDirException { - return getNewLedgerIndexFile(ledger, excludedDir, false); - } - - /** - * Get a new index file for a ledger in a lazy way. - * - +

If fallback is false, this function will throw exception when there are no writable dirs. - + If fallback is true and there's no writable dirs, it will ignore the error and pick any dir. - + Set fallback to true is useful when we want to delay disk check and just get the File pointer, e.g. fence ledger - * - * @param ledger - * Ledger id. - * @param excludedDir - * The ledger directory to exclude. - * @param fallback - * If fallback is false, the function will throw exception when there are no writable dirs; - * If it is true and there's no writable dirs, it will ignore the error and pick any dir. - * @return new index file object. - * @throws NoWritableLedgerDirException if there is no writable dir available. - */ - private File getNewLedgerIndexFile(Long ledger, File excludedDir, boolean fallback) - throws NoWritableLedgerDirException { - File dir = null; - try { - dir = ledgerDirsManager.pickRandomWritableDirForNewIndexFile(excludedDir); - } catch (NoWritableLedgerDirException e) { - if (fallback) { - dir = ledgerDirsManager.pickRandomDir(excludedDir); - } else { - throw e; - } - } + File dir = ledgerDirsManager.pickRandomWritableDirForNewIndexFile(excludedDir); String ledgerName = getLedgerName(ledger); return new File(dir, ledgerName); } -- To stop receiving notification emails like this one, please contact ['"commits@bookkeeper.apache.org" '].