You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/29 02:06:06 UTC

[GitHub] [pulsar] congbobo184 commented on a diff in pull request #16265: [fix][txn] Fix TopicTransactionBuffer ledger apend marker throw ManagedLedgerAlreadyClosedException

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: commits-unsubscribe@pulsar.apache.org

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