-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Search before reporting
- I searched in the issues and found nothing similar.
Read release policy
- 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
pulsar version 3.0.x
Issue Description
step 1: admin update topic partition from 50 to 150, throw error
step 2: see topic partition metadata has been updated to 150, and producer try to produce msg to new partition
step 3: there are 4 partition keep throw exception "topic does not exist", and other new partition can succeed.
The problem is in this pr, #19166
before pr, update partition process is:
- create missing partitions
- create subscription for new partition
- update topic metadata
after pr, it become:
- update topic metadata
- create missing partitions
- create subscription for new partition
That is not reasonable, pulsar producer and consumer rely on topic partition metadata to know whether the topic partition has been updated, if metadata updated, client can add new producer or new consumer to the new partition.
However, with the pr's change, although update partition is not complete, client regard it as success and try to construct new connection to the new topic partition. That is wrong.
There is another high risk situation, if update topic metadata and create missing partitions succeed, but fail on create subscription. In this moment, producer can send new msg to new partition, but after a while consumer may auto create subscription on new partition, and the read position is latest. That would result in consumer lost some message. It is very dangerous.
I don't understand why previous pr need to change the process, while it only illustrate clean the duplicate code
Error messages
Reproducing the issue
update partition, fail on step 2 or 3
- update topic metadata
- create missing partitions
- create subscription for new partition
Additional information
No response
Are you willing to submit a PR?
- I'm willing to submit a PR!