When isPrecise is false, sometimes it will fall back to the precise backlog count, if the mark delete position is greater than the last position, this will throw the invalid range:
2024-06-20T07:49:44,282+0800 [pulsar-stats-updater-32-1] ERROR org.apache.pulsar.broker.service.persis
tent.PersistentTopic
- Got exception when creating consumer stats for subscription xxxxx: Invalid range: (1563151:-1..1561964:1067]
Modifications
Add the mark delete position and last position checks, and then calculate the backlog
Verifying this change
This PR encapsulates the code without changing its original behavior.
Motivation
https://github.com/apache/pulsar/pull/21248 improves the backlog calculation.
When
isPrecise
is false, sometimes it will fall back to the precise backlog count, if the mark delete position is greater than the last position, this will throw the invalid range:Modifications
Verifying this change
This PR encapsulates the code without changing its original behavior.
Documentation
doc
doc-required
doc-not-needed
doc-complete