poorbarcode opened a new pull request, #25037:
URL: https://github.com/apache/pulsar/pull/25037
### Motivation
By default, the backlog of a subscription is got by `{num of entries
published} - {num of entries acknowleged}`
- `num of entries published`: `ManagedLedger.entriesAddedCounter`
- `num of entries acknowleged`: `ManagedLedger.messagesConsumedCounter`
There is bug that calculates the entries count between two positons in the
method `ManagedLedger.getNumberOfEntries`, which causes
`ManagedLedger.messagesConsumedCounter` going to a incorrect value. BTW, this
bug was introduced by https://github.com/apache/pulsar/pull/24938
It happens when the `{from position} < {currentLedger}:0` and `{to position}
> {currentLedger}:0 and {top position} < {LAC}`
### Modifications
Fix the bug.
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update
later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: x
--
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]