massakam opened a new pull request, #19759: URL: https://github.com/apache/pulsar/pull/19759
### Motivation Topic stats have a `msgRateExpired` field. Once this value is greater than 0, it may never return to 0, even though no messages have expired. This is because `PersistentMessageExpiryMonitor#updateRates()` only runs when `PersistentMessageExpiryMonitor#expireMessages()` is executed, not periodically. For example, if the number of messages in the backlog of a subscription is 0, the execution of `PersistentMessageExpiryMonitor#expireMessages()` will be skipped and `msgRateExpired` will not be updated. https://github.com/apache/pulsar/blob/cdeef00c5f6a5bd3197b4ca6de0a0505b18835d8/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java#L1062-L1071 As a result, the value of `msgRateExpired` may remain non-zero even though message expiration has not occurred recently. ### Modifications Call `PersistentMessageExpiryMonitor#updateRates()` in the `PersistentTopic#updateRates()` method that runs periodically to update the topic stats. ### Verifying this change - [ ] Make sure that the change passes the CI checks. ### 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 --> - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> -- 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]
