pulsar
pulsar copied to clipboard
[Bug] Retry topic without topic ({subscription_name}-RETRY) is getting created [broker >=3.0.6, and clients’ version is <3.0.6], related to PIP-344 compatibility
Search before reporting
- [x] I searched in the issues and found nothing similar.
Read release policy
- [x] I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.
User environment
Broker version - 2.11.0 (or <3.0.6)] Client version - 4.0.4 (or >=3.0.6)
Issue Description
- Context - We are migrating from 2.11.0 to 4. We connected a 4.0.4 client with a 2.11.0 server
- Expected - RETRY topics with topic name should've been created - {topic_name}-{sub_name}-RETRY (just like it was working with 2.11.0 server)
- What happened - RETRY topics without topic name got created - {sub_name}-RETRY, we use the service name as the subscription name. This makes all my unrelated consumer subscribers of the same RETRY topic under the same subscription.
- Bug - Backward compatibility for for non PIP-344 brokers is incomplete, merged PR that was meant to solve for compatibility
As per this PR, the implementation of the non-PIP-344 brokers will always create a new metadata in case the topic does not exist. The broker passes a value instead of the exception. Value contains
partition = 0. There is one more merged PR which updates the logic of topic existence fromif partition > 0toif partition metadata exist, when checking for the RETRY topic (without topic existence for compatibility). Non-PIP-344 broker (<3.0.6) returns metadata for the topic that does not exist. And the client (>=3.0.6) considers it as if the topic exists, and the topic without a topic name is used as the RETRY topic.
Error messages
NA
Reproducing the issue
Use client <3.0.6
Additional information
Broker version >=3.0.6 Client version <3.0.6 Have multiple consumer-topic relationships with the same subscription name.
Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
@poorbarcode Do you have a chance to take a look at this since this is PIP-344 related?