merlimat commented on a change in pull request #5322: Fix bk write failure part 
2
URL: https://github.com/apache/pulsar/pull/5322#discussion_r332197410
 
 

 ##########
 File path: 
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
 ##########
 @@ -624,6 +617,12 @@ private synchronized void 
internalAsyncAddEntry(OpAddEntry addOperation) {
         }
     }
 
+    @Override
+    public void readyToCreateNewLedger() {
+       // only set transition state to ClosedLedger if current state is 
WriteFailed
+       STATE_UPDATER.compareAndSet(this, State.WriteFailed, 
State.ClosedLedger);
 
 Review comment:
   ```suggestion
          if (STATE_UPDATER.compareAndSet(this, State.WriteFailed, 
State.ClosedLedger)) {
              log.info("[{}] Managed ledger is now ready to accept writes 
again", name);
          }
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to