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 2022/06/13 06:32:06 UTC

[GitHub] [bookkeeper] gaozhangmin commented on pull request #3329: Fix data lose when configured multiple ledger directories

gaozhangmin commented on PR #3329:
URL: https://github.com/apache/bookkeeper/pull/3329#issuecomment-1153526529

   @hangc0276 I found when syncThread do flush, there exists duplicate `checkpointComplete` invoke.
   
   SyncThread flush:
   ```
   private void flush() {
           Checkpoint checkpoint = checkpointSource.newCheckpoint();
           try {
               ledgerStorage.flush();
           } catch (NoWritableLedgerDirException e) {
               log.error("No writeable ledger directories", e);
               dirsListener.allDisksFull(true);
               return;
           } catch (IOException e) {
               log.error("Exception flushing ledgers", e);
               return;
           }
   
           if (disableCheckpoint) {
               return;
           }
   
           log.info("Flush ledger storage at checkpoint {}.", checkpoint);
           try {
               checkpointSource.checkpointComplete(null, checkpoint, false);
           } catch (IOException e) {
               log.error("Exception marking checkpoint as complete", e);
               dirsListener.allDisksFull(true);
           }
       }
   ```
   
   ```
   @Override
       public void flush() throws IOException {
           Checkpoint cp = checkpointSource.newCheckpoint();
           checkpoint(cp);
           checkpointSource.checkpointComplete(ledgerDir, cp, true);
       }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org