pulsar
pulsar copied to clipboard
[Bug] Can create both partitioned and non-partitioned topics with the same name.
Search before asking
- [X] I searched in the issues and found nothing similar.
Version
3.0.2
Minimal reproduce step
Broker.conf
-
allowAutoTopicCreation
:true
-
allowAutoTopicCreationType
:partitioned
-
defaultNumPartitions
:1
The latest version of the Go client
- Create a consumer and subscribe
public/default/tp1
- Broker will create a partitioned topic
public/default/tp1
with1
partition at the step
- Broker will create a partitioned topic
- Create a reader and subscribe
public/default/tp1
- Broker will create a non-partitioned topic
public/default/tp1
- Broker will create a non-partitioned topic
Two bugs:
- the reader of the Go client should get topic metadata first, then try to subscribe to the partitioned topic. The actual behavior is it subscribes to the
public/default/tp1
as a non-partitioned topic. This bug will be fixed in https://github.com/apache/pulsar-client-go - **(Highlight)**The Go client should get a not-found error when the reader tries to subscribe to
public/default/tp1
as a non-partitioned topic. This bug is the current issue point.
What did you expect to see?
What did you see instead?
Anything else?
No response
Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
@RobertIndie Thanks for fix this bug ❤️
We have faced the same issue in Pulsar 3.1.3 and Java Client 3.2.1. There was a race condition, consumers/producers were created during setting on a namespace level:
allowAutoTopicCreation: true
allowAutoTopicCreationType: partitioned
defaultNumPartitions:6