-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Fix issue where msgRateExpired may not refresh forever #19759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
poorbarcode
approved these changes
Mar 9, 2023
Technoboy-
approved these changes
Mar 9, 2023
Codecov Report
@@ Coverage Diff @@
## master #19759 +/- ##
=============================================
+ Coverage 32.05% 62.01% +29.95%
- Complexity 6409 25829 +19420
=============================================
Files 1674 1848 +174
Lines 126556 135887 +9331
Branches 13810 14953 +1143
=============================================
+ Hits 40570 84264 +43694
+ Misses 79992 43905 -36087
- Partials 5994 7718 +1724
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Technoboy-
pushed a commit
that referenced
this pull request
Mar 12, 2023
Technoboy-
pushed a commit
that referenced
this pull request
May 6, 2023
nicoloboschi
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 11, 2023
…pache#19759) (cherry picked from commit 9a9f005)
2 tasks
Merged
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/broker
cherry-picked/branch-2.10
cherry-picked/branch-2.11
doc-not-needed
Your PR changes do not impact docs
ready-to-test
release/2.10.5
release/2.11.1
type/bug
The PR fixed a bug or issue reported a bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Topic stats have a
msgRateExpiredfield. Once this value is greater than 0, it may never return to 0, even though no messages have expired. This is becausePersistentMessageExpiryMonitor#updateRates()only runs whenPersistentMessageExpiryMonitor#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 andmsgRateExpiredwill not be updated.pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java
Lines 1062 to 1071 in cdeef00
As a result, the value of
msgRateExpiredmay remain non-zero even though message expiration has not occurred recently.Modifications
Call
PersistentMessageExpiryMonitor#updateRates()in thePersistentTopic#updateRates()method that runs periodically to update the topic stats.Verifying this change
Documentation
docdoc-requireddoc-not-neededdoc-complete