-
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][client] Fix negative acknowledgement by messageId #23060
Conversation
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.
Good catch
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #23060 +/- ##
============================================
- Coverage 73.57% 73.43% -0.15%
- Complexity 32624 33480 +856
============================================
Files 1877 1915 +38
Lines 139502 143943 +4441
Branches 15299 15725 +426
============================================
+ Hits 102638 105703 +3065
- Misses 28908 30126 +1218
- Partials 7956 8114 +158
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Great catch @izumo27 !
Would it be possible to add a test case for this scenario? |
(cherry picked from commit d4bbf10)
(cherry picked from commit d4bbf10)
(cherry picked from commit d4bbf10)
This is testing whether the messages are deleted from the unAckedMessageTracker. |
(cherry picked from commit d4bbf10)
@lhotari It seems that #20750 has not been cherry-picked into branch 3.0. |
Motivation
related: #20750
When adding to
unAckedMessageTracker
, the messageId type is converted toMessageIdImpl
.If calling
ConsumerImpl#negativeAcknowledge(MessageId)
and the messageId type isBatchMessageIdImpl
, the message will not be removed from theunAckedMessageTracker
.https://github.com/apache/pulsar/blob/v3.3.0/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L814
This will cause both negative ack redeliver and ack timeout redeliver.
Modifications
Convert the messageId type to remove the message from
unAckedMessageTracker
.Verifying this change
(Please pick either of the following options)
This change added tests and can be verified as follows:
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: izumo27#5