[fix][txn]fix receive duplicated messages due to pendingAcks in PendingAckHandle - #19581
Merged
Conversation
|
@aloyszhang Please add the following content to your PR description and select a checkbox: |
congbobo184
reviewed
Feb 21, 2023
congbobo184
left a comment
Contributor
There was a problem hiding this comment.
LGTM! left some comments
congbobo184
approved these changes
Feb 21, 2023
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.
|
poorbarcode
approved these changes
Feb 22, 2023
Member
|
@aloyszhang Can you help cherry-pick this PR to branch-2.9? |
Technoboy-
pushed a commit
that referenced
this pull request
Mar 6, 2023
…ngAckHandle (#19581) Co-authored-by: mayozhang <mayozhang@tencent.com>
Member
|
Due to #14327 be moved 2.9.6, so this PR also move to 2.9.6 |
Member
|
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 |
This was referenced Sep 14, 2023
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
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