-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix][broker] Handle BucketDelayedDeliveryTracker recover failed #22735
[fix][broker] Handle BucketDelayedDeliveryTracker recover failed #22735
Conversation
pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/DelayedDeliveryTrackerDisable.java
Outdated
Show resolved
Hide resolved
@dao-jun Can you add tests to cover this case? |
Yes, but before add test, I want to get more feedbacks, to make sure this change is reasonable |
.../java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
Outdated
Show resolved
Hide resolved
.../java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
Outdated
Show resolved
Hide resolved
.../java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22735 +/- ##
============================================
- Coverage 73.57% 73.19% -0.39%
+ Complexity 32624 32591 -33
============================================
Files 1877 1891 +14
Lines 139502 141466 +1964
Branches 15299 15519 +220
============================================
+ Hits 102638 103543 +905
- Misses 28908 29924 +1016
- Partials 7956 7999 +43
Flags with carried forward coverage won't be shown. Click here to find out more.
|
...oker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BucketDelayedDeliveryTracker.java
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Show resolved
Hide resolved
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.
) (cherry picked from commit 1c53841)
…che#22735) (cherry picked from commit 1c53841) (cherry picked from commit 257ca7f)
…che#22735) (cherry picked from commit 1c53841) (cherry picked from commit 257ca7f)
Motivation
We initialize
DelayedDeliveryTracker
when dispatch messages by callingDelayedDeliveryTrackerFactory.newTracker
inAbstractBaseDispatcher
.However, when we set
delayedDeliveryTrackerFactoryClassName
toorg.apache.pulsar.broker.delayed.BucketDelayedDeliveryTrackerFactory
,BucketDelayedDeliveryTracker
has a chance to recover failed(see here ), it may caused by Bookkeeper exception, timeout exception or sth else, and we don't handle the case.If the exception happens, it may lead to memory leaks(Entries, OpReadEntry are unable to release) and some other issues,
if
BucketDelayedDeliveryTracker
always unable to recover, the situation will worsen.The PR introduces fallback mechanism, if initialize
BucketDelayedDeliveryTracker
failed, fallback toInMemoryDelayedDeliveryTracker
to handle this case.Modifications
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: