sijie commented on a change in pull request #205: Issue 208: Improve ledger fence logic URL: https://github.com/apache/bookkeeper/pull/205#discussion_r124839179
########## File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexPersistenceMgr.java ########## @@ -177,7 +177,35 @@ private FileInfo putFileInfo(Long ledger, byte masterKey[], File lf, boolean cre */ private File getNewLedgerIndexFile(Long ledger, File excludedDir) throws NoWritableLedgerDirException { - File dir = ledgerDirsManager.pickRandomWritableDir(excludedDir); + return getNewLedgerIndexFile(ledger, excludedDir, false); Review comment: First of all, creating a index file doesn't mean we really write any data to this file. the real file creation happens only when the ledger is flushed. The creation of the index file to hold the states eg fencing state for flushing later on. Secondly, the problem this issue tries to address here is even the we don't have writable disks, the fence requests should go through since we only need the fence state is set in the file info cache and persisted in the journal. The change of fallback is for this purpose. Thirdly, it doesn't have to check the fullness, because the creation of the index file happens in the memory at this point. It is deferred to create at flushing time. When a ledger is flushed, it will check the fullness and do the relocate if it is necessary. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services