apache / pulsar

Apache Pulsar - distributed pub-sub messaging system
https://pulsar.apache.org/
Apache License 2.0
14.15k stars 3.57k forks source link

[fix][broker] Check the markDeletePosition and calculate the backlog #22947

Closed nodece closed 3 months ago

nodece commented 3 months ago

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:

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

Verifying this change

This PR encapsulates the code without changing its original behavior.

Documentation