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

   ### Motivation
   fix different transactions ack the same batch message with different batch 
Index bug.
   
   now when the first ack the batch message with the transaction will put the 
current request position into the pending ack map 
   
https://github.com/apache/pulsar/blob/9f40cc1d1104900c450a599676ca446b1f096a00/pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java#L772
   
   but it will produce errors in some case
   
   eg. bach size is 3
   in this case:
   1. first txn ack the message will the batch Index 0, ackSet is `0 1 1`
   2. send txn ack the message with the batch index 1, ack set is `0 0 1`
   3. commit the first txn will ack the batch index 0, 1 in this cursor in 
batch index ack is `0 0 1`
   4. abort the second txn will redeliver the message
   5. third txn repeat ack the message with the batch index 1, because txn is 
aborted
   6. the third txn will not ack successful because the first txn has changed 
the acks set to 0 0 1 in cursor in batch index ack map.
   ### Modifications
   change the first position ack class to a new position class will not ack 
with the error ack set
   ### Verifying this change
   add a test for it 
   
   the third txn will ack the second message successful
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   
     - Does this pull request introduces a new feature? (yes)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs 
/ not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a follow-up 
issue for adding the documentation
   


-- 
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