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/24 02:23:14 UTC
[GitHub] [pulsar] codelipenghui commented on a change in pull request #14830: [fix][txn]: fix transaction buffer no snapshot close recover reader
codelipenghui commented on a change in pull request #14830:
URL: https://github.com/apache/pulsar/pull/14830#discussion_r833862028
##########
File path: pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/TopicTransactionBufferRecoverTest.java
##########
@@ -504,4 +506,23 @@ public void testTransactionBufferRecoverThrowBrokerMetadataException() throws Ex
txn.commit().get();
}
+
+ @Test
+ public void testTransactionBufferNoSnapshotCloseReader() throws Exception{
+ String topic = NAMESPACE1 + "/test";
+ @Cleanup
+ Producer<String> producer = pulsarClient.newProducer(Schema.STRING).producerName("testTxnTimeOut_producer")
+ .topic(topic).sendTimeout(0, TimeUnit.SECONDS).enableBatching(false).create();
+
+ admin.topics().unload(topic);
+
+ // unload success, all readers have been closed except for the compaction sub
+ producer.send("test");
+ TopicStats stats = admin.topics().getStats(NAMESPACE1 + "/" + TRANSACTION_BUFFER_SNAPSHOT);
+
+ // except for the compaction sub
+ assertEquals(stats.getSubscriptions().size(), 1);
Review comment:
Do you need to check if the subscriptions should > 1 before and then be clean up later?
--
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