sijie commented on a change in pull request #205: Issue 208: Improve ledger fence logic URL: https://github.com/apache/bookkeeper/pull/205#discussion_r124876380
########## File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDescriptorImpl.java ########## @@ -81,6 +85,52 @@ ByteBuf getExplicitLac() { return ledgerStorage.getExplicitLac(ledgerId); } + synchronized SettableFuture<Boolean> fenceAndLogInJournal(Journal journal) throws IOException { + boolean success = this.setFenced(); + if(success) { + // fenced for first time, we should add the key to journal ensure we can rebuild. + return logFenceEntryInJournal(journal); + } else { + // If we reach here, it means this ledger has been fenced before. + // However, fencing might still be in progress. Review comment: done. I have improved the comments. ---------------------------------------------------------------- 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