izumo27 opened a new pull request, #23060:
URL: https://github.com/apache/pulsar/pull/23060

   ### Motivation
   related: https://github.com/apache/pulsar/pull/20750
   
   When adding to `unAckedMessageTracker`, the messageId type is converted to 
`MessageIdImpl`.
   - 
https://github.com/apache/pulsar/blob/v3.3.0/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java#L1162-L1167
   - 
https://github.com/apache/pulsar/blob/v3.3.0/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L1820-L1827
   
   If calling `ConsumerImpl#negativeAcknowledge(MessageId)` and the messageId 
type is `BatchMessageIdImpl`, the message will not be removed from the 
`unAckedMessageTracker`.
   
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
   
   - [x] Make sure that the change passes the CI checks.
   
   *(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:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *If the box was checked, please highlight the changes*
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [x] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update 
later -->
   - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [x] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: https://github.com/izumo27/pulsar/pull/5
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to