rvashishth opened a new issue #9603: URL: https://github.com/apache/pulsar/issues/9603
**Describe the bug** A subscription with default/latest initial position gets data produces(and retained) before subscription was created. A subscription created with initial position latest acts as if it's a subscription with earliest position. **To Reproduce** Steps to reproduce the behavior: 1. Create a topic with retention by size/time policy 2. Produce message on this topic. Since no subscription exist, these messages will be retained on topic due to retention policy. 3. Create a subscription with [default initial position: Latest](https://github.com/apache/pulsar/blob/301d42ce04ceb20797cc2a60267e6ec39ff05e95/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java#L2025) using pulsar admin rest api 4. Subscription backlog contains messages produced before subscription was created **Expected behavior** A subscription created with SubscriptionInitialPosition.Latest should not get message produced before the subscription was created **Screenshots** NA **Desktop (please complete the following information):** - Pulsar version 2.7.0 **Additional context** NA ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
