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

   @michaeljmarshall 
   
   > What version of the Java client are you using?
   
   It should be `2.9.x` or `2.10.x`. I need to reconfirm it with my colleague
   
   > The client is supposed to resend all unack'd messages upon creating a new 
producer. Are you seeing the client resend the messages?
   
   Do you mean the resend by the method 
[ProducerImpl.recoverProcessOpSendMsgFrom](https://github.com/apache/pulsar/blob/master/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java#L2244)?<sup>[1]</sup>
   
   If yes<sup>[1]</sup>, there are two issues:
   
   #### Issues-1: When sent again, the producer is removed by the new broker, 
for example:
   
   | time | `producer-1` | `broker-1` | `broker-2` | `broker-3` |
   | --- | --- | --- | --- | --- |
   | 1 | | topic owner |
   | 2 | send msg to `broker-1`| remove `producer-1` due to unloading topic |
   | 3 | | | topic owner |
   | 4 | resend msg to `broker-2` and remove msg from the `pending ops queue` | 
| remove producer-1 due to unloading topic |
   | 5 | | | | topic owner |
   | 6 | <strong>(Highlight)</strong>the msg won't be resend because the 
`pending ops queue` is empty |
   
   #### Issues-2: First request timeout and resend are completed at the same 
time(Maybe this issue exists before #19446):
   
   | time | `producer-1` | `broker-1` | `broker-2` |
   | --- | --- | --- | --- |
   | 1 | | topic owner |
   | 2 | async send `[msg1, msg2, msg3, msg4]` to `broker-1`| remove 
`producer-1` due to unloading topic |
   | 3 | | | topic owner |
   | 4 | since the request is still in the `clientCnx.pendingRequests`, it will 
be triggered timeout | | responds success to the client |
   | 5 | `msg1` was triggered timeout in the thread `scheduled thread(a random 
thread in eventLoopGroup)` |
   | 6 | | | `msg2` was completed in the thread `io thread` |
   | 7 | `msg3` was triggered timeout in the thread `scheduled thread(a random 
thread in eventLoopGroup)` |
   | 8 | | | `msg4` was completed in the thread `io thread` |
   
   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?
   


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