TakaHiR07 opened a new issue, #25041:
URL: https://github.com/apache/pulsar/issues/25041

   ### Search before reporting
   
   - [x] I searched in the [issues](https://github.com/apache/pulsar/issues) 
and found nothing similar.
   
   
   ### Read release policy
   
   - [x] I understand that [unsupported 
versions](https://pulsar.apache.org/contribute/release-policy/#supported-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, https://github.com/apache/pulsar/pull/19166
   before pr, update partition process is: 
   1. create missing partitions
   2. create subscription for new partition
   3. update topic metadata
   
   after pr, it become:
   1. update topic metadata
   2. create missing partitions
   3. 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 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
   
   ```text
   
   ```
   
   ### Reproducing the issue
   
   update partition, fail on step 2 or 3
   
   1. update topic metadata
   2. create missing partitions
   3. create subscription for new partition
   
   ### Additional information
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


-- 
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]

Reply via email to