BewareMyPower opened a new pull request, #988:
URL: https://github.com/apache/pulsar-client-go/pull/988

   ### Motivation
   
   Currently, when `EnableBatchIndexAck` is true, the ACK performance is very 
poor. There are two main reasons:
   1. Acknowledgment by list is not supported. It means that even N MessageIDs 
are grouped, there are still N ACK requests to send.
   2. The implementation of ACK grouping tracker is wrong. Give a batch that 
has N messages, when batch index ACK is enabled, each MessageID is cached. 
However, after all these N MessageIDs arrived, the current implementation does 
not clear them.
   
   ### Modifications
   - Add a `func(id []*pb.MessageIdData)` to the ACK grouping tracker. When 
flushing individual ACKs, construct the slice and wrap the slice to 
`CommandAck` directly.
   - Refactor the implementation of the ACK grouping tracker to have these two 
data structures:
     - `pendingAcks`: Cache the non-batched MessageIDs
     - `pendingBatchAcks`: Cache the batched MessageIDs, once all messages in a 
batch have been added, remove them from it and add the non-batched MessageID to 
`pendingAcks`
   - Add `TestBatchIndexAckAllMessages` to verify the new behavior.
   
   After this change, the ACK order cannot be guaranteed, sort the acknowledged 
MessageIDs in the `ack_grouping_tracker_test.go`.


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