You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/07/20 17:46:27 UTC

[GitHub] jvrao commented on a change in pull request #1560: ISSUE #1559: Fix for moveLedgerIndexFile logic in relocateIndexFileAndFlushHeader

jvrao commented on a change in pull request #1560: ISSUE #1559: Fix for moveLedgerIndexFile logic in relocateIndexFileAndFlushHeader
URL: https://github.com/apache/bookkeeper/pull/1560#discussion_r204120489
 
 

 ##########
 File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexPersistenceMgr.java
 ##########
 @@ -494,7 +494,20 @@ int getOpenFileLimit() {
     private void relocateIndexFileAndFlushHeader(long ledger, FileInfo fi) throws IOException {
         File currentDir = getLedgerDirForLedger(fi);
         if (ledgerDirsManager.isDirFull(currentDir)) {
-            moveLedgerIndexFile(ledger, fi);
+            try {
+                moveLedgerIndexFile(ledger, fi);
+            } catch (NoWritableLedgerDirException nwe) {
+                /*
+                 * if there is no other indexDir, which could accommodate new
+                 * indexFile but the current indexDir has enough space
+                 * (minUsableSizeForIndexFileCreation) for this flushHeader
+                 * operation, then it is ok to proceed without moving
+                 * LedgerIndexFile.
+                 */
+                if (!ledgerDirsManager.isDirWritableForNewIndexFile(currentDir)) {
 
 Review comment:
   Add info log message here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services