congbobo184 commented on code in PR #16265:
URL: https://github.com/apache/pulsar/pull/16265#discussion_r909134599


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java:
##########
@@ -375,6 +377,12 @@ public void addFailed(ManagedLedgerException exception, 
Object ctx) {
         return completableFuture;
     }
 
+    private void checkAppendMarkerException(ManagedLedgerException exception) {
+        if (exception instanceof 
ManagedLedgerException.ManagedLedgerAlreadyClosedException) {
+            topic.getManagedLedger().readyToCreateNewLedger();

Review Comment:
   `topic.getManagedLedger().readyToCreateNewLedger();` this method is 
   ```
   if (STATE_UPDATER.compareAndSet(this, State.WriteFailed, 
State.ClosedLedger)){
              log.info("[{}] Managed ledger is now ready to accept writes 
again", name);
          }
   ```
   
   so we don't need to check the state is `State.WriteFailed`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to