-
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] Fix items in dispatcher.recentlyJoinedConsumers are out-of-order, which may cause a delivery stuck #23802
[fix] [broker] Fix items in dispatcher.recentlyJoinedConsumers are out-of-order, which may cause a delivery stuck #23802
Conversation
…t-of-order, which may cause a delivery stuck
/pulsarbot rerun-failure-checks |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #23802 +/- ##
============================================
+ Coverage 73.57% 74.12% +0.55%
+ Complexity 32624 2374 -30250
============================================
Files 1877 1853 -24
Lines 139502 143456 +3954
Branches 15299 16291 +992
============================================
+ Hits 102638 106338 +3700
+ Misses 28908 28716 -192
- Partials 7956 8402 +446
Flags with carried forward coverage won't be shown. Click here to find out more.
|
...rg/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java
Outdated
Show resolved
Hide resolved
.../pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumersClassic.java
Show resolved
Hide resolved
@poorbarcode Please also help summarize the discussion between us to the PR description. I think it should be added to the |
Added |
…t-of-order, which may cause a delivery stuck (apache#23802) (cherry picked from commit 3d71c87) (cherry picked from commit 5cec5ed)
…t-of-order, which may cause a delivery stuck (apache#23802) (cherry picked from commit 3d71c87) (cherry picked from commit 5cec5ed)
Motivation
Background
rewind
rewind
will be delayed after the pending read is complete.dispatcher.recentlyJoinedConsumers
ofkey_shared
mode guarantees delivery in order, it records thecursor.readPosition
when consumers join.Issue: a case that makes items in
dispatcher.recentlyJoinedConsumers
out-of-order, the steps to reproduce the issue are as follows:3
consumers:c1
,c2
,c3
c1
andc2
consumed all messages that they received.c3
is stuckLAC
:3:299
,cursor.readPosition
:3:300
,mard-deleted-position
:3:100
c3
afterc3
is removed.c1
andc2
are also off-line, which will trigger arewind
rewind
will be delayed.consumer-4
joined, itsrecentlyJoinedPosition
was set to3:300
rewind
was triggered.LAC
:3:299
,cursor.readPosition
:3:101
,mard-deleted-position
:3:100
consumer-5
joined, itsrecentlyJoinedPosition
was set to3:101
you can reproduce the issue by the new test
NonEntryCacheKeySharedSubscriptionV30Test
Modifications
rewind
was executed, clear the collectiondispatcher.recentlyJoinedConsumers
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: x