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/03/22 12:39:48 UTC

[GitHub] [pulsar] codelipenghui commented on a change in pull request #14801: [fix][txn]: fix transaction buffer recover reader and writer fail

codelipenghui commented on a change in pull request #14801:
URL: https://github.com/apache/pulsar/pull/14801#discussion_r832117787



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java
##########
@@ -178,15 +178,17 @@ public void handleTxnEntry(Entry entry) {
                     }
 
                     @Override
-                    public void recoverExceptionally(Exception e) {
-                        if (e instanceof PulsarClientException.BrokerMetadataException) {
+                    public void recoverExceptionally(Throwable e) {
+                        // when create reader or writer fail throw PulsarClientException,
+                        // should close this topic and then reinit this topic
+                        if (e instanceof PulsarClientException) {
                             log.warn("Closing topic {} due to read transaction buffer snapshot while recovering the "
                                     + "transaction buffer throw exception", topic.getName(), e);
                             topic.close();

Review comment:
       Need to force close the topic? and close the topic might introduce exceptions, which will lead to the transactionBufferFuture never being complete.




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