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/28 09:46:02 UTC

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

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


##########
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:
   Do we need to check the state is `State.WriteFailed`? 
   
   ```
   else if (state == State.Closed) {
               addOperation.failed(new ManagedLedgerAlreadyClosedException("Managed ledger was already closed"));
               return;
           } else if (state == State.WriteFailed) {
               addOperation.failed(new ManagedLedgerAlreadyClosedException("Waiting to recover from failure"));
               return;
           }
   ```
   
   We also remove in this PR https://github.com/apache/pulsar/pull/14738/files#diff-4fb66809c520962f28616ddcab91aca0abb7aa04ee3ef0703097cf5976080ba8L166-L168
   
   @congbobo184 Do you remember the context?



-- 
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