michaeljmarshall commented on PR #21134:
URL: https://github.com/apache/pulsar/pull/21134#issuecomment-1706998307

   I am working from my memory here, but I'm pretty sure this is the way it 
ought to work.
   
   > the msg won't be resend because the pending ops queue is empty
   
   Messages are resent from the `pendingMessages` iterator. Note that the 
`pending ops queue` (assuming you mean the `msgIterator`) is built as 
`pendingMessages.iterator()`. This is necessary because any time we resend 
messages, they must be done from the earliest unacked message in order to 
retain message order. As far as I can tell, messages are not actually removed 
from `pendingMessages` until they are ack'd, timedout, or get an error from the 
broker.
   
   > Then msg1 and msg3 were timeout(in fact, they were successful), but msg2 
and msg4 were sent successful. In this case, what should the user do?
   
   I am not sure that I follow the events listed in this table. What is the 
purpose of referenced in the table?
   
   It's relevant to point out that any time we have a send timeout, it is 
possible for messages to persist with "holes" and therefore out of order. 
   
   Also, note that there is synchronization on the `ProducerImpl.this` object 
that is intended to prevent certain race conditions.


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