void-ptr974 opened a new issue, #26178:
URL: https://github.com/apache/pulsar/issues/26178
### Issue Description
When increasing the partition count of a normal partitioned topic, Pulsar
copies
durable subscription properties from partition-0 to newly created partitions.
Bucket delayed delivery persists cursor-local snapshot metadata as:
```text
#pulsar.internal.delayed.bucket_<startLedgerId>_<endLedgerId> =
<snapshotLedgerId>
```
This metadata belongs to partition-0 and its snapshot contains
delayed-message
positions from partition-0.
After partition expansion, the new partition inherits these bucket properties
despite having no corresponding delayed messages. When a consumer connects
to the
new partition, its bucket delayed-delivery tracker can load the snapshot and
recover delayed-message indexes from partition-0.
This gives the new partition incorrect delayed-delivery state and can lead to
invalid replay attempts for positions that do not belong to it.
### Reproducing the issue
1. Enable bucket delayed delivery.
2. Create a persistent partitioned topic with one partition and a durable
subscription.
3. Publish enough delayed messages to create a bucket snapshot.
4. Increase the partition count from one to two.
5. Connect a consumer to the new partition.
Expected: the new partition has no delayed-delivery bucket state.
Actual: the new partition inherits
`#pulsar.internal.delayed.bucket*` properties from partition-0 and can
recover
partition-0 delayed-message indexes.
### Additional information
This affects normal partition-count increases for durable subscriptions.
Scalable topics are not involved.
--
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]