-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][txn]fix receive duplicated messages due to pendingAcks in PendingAckHandle #19581
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
Conversation
|
@aloyszhang Please add the following content to your PR description and select a checkbox: |
congbobo184
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! left some comments
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/util/PositionAckSetUtil.java
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #19581 +/- ##
=============================================
+ Coverage 24.65% 62.11% +37.45%
- Complexity 291 25735 +25444
=============================================
Files 1591 1844 +253
Lines 123073 135341 +12268
Branches 13434 14884 +1450
=============================================
+ Hits 30348 84069 +53721
+ Misses 88233 43533 -44700
- Partials 4492 7739 +3247
Flags with carried forward coverage won't be shown. Click here to find out more.
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractBaseDispatcher.java
Outdated
Show resolved
Hide resolved
|
@aloyszhang Can you help cherry-pick this PR to branch-2.9? |
…ngAckHandle (#19581) Co-authored-by: mayozhang <mayozhang@tencent.com>
|
Due to #14327 be moved 2.9.6, so this PR also move to 2.9.6 |
|
As discussed on the mailing list https://lists.apache.org/thread/w4jzk27qhtosgsz7l9bmhf1t7o9mxjhp, there is no plan to release 2.9.6, so I am going to remove the release/2.9.6 label |
Motivation
There're some cases of consumers receiving duplicated messages when there are ongoing transactions within a subscription.
#14327 has fixed this problem partially. But there's still a chance for consumers to receive duplicated messages.
For non-batch messages, the dispatcher does not filter messages in the pendingAck state(PendingAckHandleImpl#individualAckPositions)
For batch messages, if the ackSet in pendingAck state is complimentary with the ackSet in the cursor, the broker still dispatches this entry to the consumer. For example, a batch message has 5 messages internal, cursor stats has acked
0,1,2and pendingAck stats has acked3,4, this message should not dispatch to the consumer, but actually, it does.Modifications
Verifying this change
Documentation
doc-not-neededMatching PR in forked repository
PR in forked repository:
aloyszhang#15