-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[improve][broker]Improve the anti-concurrency mechanism expirationCheckInProgress #24607
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
[improve][broker]Improve the anti-concurrency mechanism expirationCheckInProgress #24607
Conversation
...rc/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageExpiryMonitor.java
Show resolved
Hide resolved
|
After further investigation, I found that this PR may not address the root cause. The |
|
/pulsarbot rerun-failure-checks |
lhotari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. However, this looks like a bug fix instead of an improvement.
yes, They are different cases.I'm just saying this change might not really fix the issue you mentioned. But I'm +1 with this change. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #24607 +/- ##
============================================
+ Coverage 74.21% 74.32% +0.10%
+ Complexity 33142 32654 -488
============================================
Files 1881 1881
Lines 146770 146778 +8
Branches 16859 16857 -2
============================================
+ Hits 108922 109089 +167
+ Misses 29181 29014 -167
- Partials 8667 8675 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…ckInProgress (apache#24607) (cherry picked from commit 66b512c)
|
@poorbarcode Please handle backporting to branch-3.3 . I tried that, but the test fails my backport attempt to branch-3.3: branch-3.3...lhotari:pulsar:lh-pr24607-branch-3.3, backport commit 4485218 |
…ckInProgress (apache#24607) (cherry picked from commit 47b7307)
…ationCheckInProgress (apache#24607)" This reverts commit 25a88a6.
…ationCheckInProgress (apache#24607)" This reverts commit 25a88a6.
…ckInProgress (apache#24607) (cherry picked from commit 47b7307)
…ationCheckInProgress (apache#24607)" This reverts commit 25a88a6.
@poorbarcode ping |
…ckInProgress (apache#24607) (cherry picked from commit 47b7307)
|
@lhotari I removed the label |
…ckInProgress (apache#24607) (cherry picked from commit 47b7307)
Motivation
If more the one task named
expireMessagewere executed at the same time, the mechanismexpirationCheckInProgressprevents them from executing concurrently, but it is not well enough.task: expire msg 1task: expire msg 2expirationCheckInProgress->true[1]expirationCheckInProgress->falsesup>[3]expirationCheckInProgress->true[1]cursor reset in progress - ignoring mark delete on position [{}] for cursor [{}]PersistentSubscription.expireMessagesPersistentMessageExpiryMonitor.expireMessagesPersistentMessageExpiryMonitor.findEntryCompleteThe above concurrency wasted a finding target position, which is a heavy operation.
The logs that were printed when our cluster encountered the performance issue
Modifications
Release the lock
expirationCheckInProgressafter resetting the cursor successfully.Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: x