horizonzy opened a new issue, #15475: URL: https://github.com/apache/pulsar/issues/15475
**Describe the bug** In PersistentTopics, there are two methods `createNonPartitionedTopic` and `createPartitionedTopic`. There is race condition, maybe create nonpartitioned and partitioned managed-ledgers. **To Reproduce** **broker** I modify some code to help to reproduce problem. see commit: https://github.com/horizonzy/pulsar/commit/991bf82f218567cea5c3511b7a807b55652c596e **client** ``` PulsarAdminBuilder pulsarAdminBuilder = new PulsarAdminBuilderImpl().serviceHttpUrl("http://localhost:8080"); PulsarAdmin admin = pulsarAdminBuilder.build(); admin.topics().createNonPartitionedTopicAsync("horizon-topic"); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } admin.topics().createPartitionedTopicAsync("horizon-topic", 4); ``` **Expected behavior** Maybe we need check ownership before operation to avoid distributed lock, and introduce jvm lock to avoid it. **Picture** <img width="1680" alt="image" src="https://user-images.githubusercontent.com/22524871/167168493-d1b2ceef-472e-4fe7-8de4-484455bb49e1.png"> -- 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]
