codelipenghui commented on code in PR #19031:
URL: https://github.com/apache/pulsar/pull/19031#discussion_r1059725292


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -204,6 +208,10 @@
 
     private final AtomicReference<ClientCnx> 
clientCnxUsedForConsumerRegistration = new AtomicReference<>();
     private final List<Throwable> previousExceptions = new 
CopyOnWriteArrayList<Throwable>();
+    // Key is the ledger id and the entry id, entry is the acker that 
represents which single messages are acknowledged
+    private final ConcurrentNavigableMap<Pair<Long, Long>, BatchMessageAcker> 
batchMessageToAcker =

Review Comment:
   The `id2` can be acked first, but the client crashed while processing 
message 1 (Shared subscription and users multiple threads to process messages). 
I mean that users do not want to miss the ack intentionally. But we can't 
guarantee the messages of a batch will be processed in order of a Shared 
subscription. Even if it is a Failover or Exclusive subscription, users can 
also ack individually and process messages out of order.
   
   > Regarding the reconnection or ack failure
   
   I point out this one because a server-side cursor reset can cause the 
reconnection. But it should not be a problem that this PR should fix.



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