[Bug] [ml] The readPosition is greater than the lastPosition
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
### Search before asking
- [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 don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.
### Version
2.9.2
### Minimal reproduce step
Currently, it cannot be reproduced stably.
### What did you expect to see?
readPosition <= lastPosition + 1
### What did you see instead?
readPosition > lastPosition + 1
### Anything else?
The following is an example in a real scenario:
The topic max ledger is 35992528, but the readPosition ledger has reached 36641783.


The problem we encountered is relatively similar to the one here:
https://github.com/apache/pulsar/pull/17454
### Are you willing to submit a PR?
- [X] I'm willing to submit a PR!
Contributor guide
Research direction
Start by reviewing the readPosition and lastPosition behavior described in this issue and compare it with Apache Pulsar pull request #17454. Attempt reproduction on the stated Pulsar 2.9.2 version, then trace the relevant managed-ledger or consumer code once the failing path is identified. Done means the cause is established and the readPosition invariant is preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100