liangyepianzhou commented on code in PR #20948:
URL: https://github.com/apache/pulsar/pull/20948#discussion_r1304997867


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -1449,6 +1449,15 @@ private ByteBuf processMessageChunk(ByteBuf 
compressedPayload, MessageMetadata m
         // discard message if chunk is out-of-order
         if (chunkedMsgCtx == null || chunkedMsgCtx.chunkedMsgBuffer == null

Review Comment:
   The case of `chunkedMsgCtx == null`:
   **Case 1:** 
   ```
   chunk-0 sequence ID: 1, chunk ID: 1
   chunk-1 sequence ID: 1, chunk ID: 0
   chunk-2 sequence ID: 1, chunk ID: 1
   ```
   **Case 2:**
   ```
   chunk-0 sequence ID: 1, chunk ID: 1
   chunk-1 sequence ID: 1, chunk ID: 0
   ```
   **Case 3:**
   ```
   chunk-0 sequence ID: 1, chunk ID: 0
   chunk-1 sequence ID: 1, chunk ID: 1
   chunk-2 sequence ID: 1, chunk ID: 1
   ```
   I caught `chunkedMsgCtx == null` with `msgMetadata.getChunkId() <= 
chunkedMsgCtx.lastChunkedMessageId` when encounter Case 3.
   However, after reminders and deliberation, I think these three cases can all 
be processed by the original logic. 
   
   /cc @BewareMyPower @poorbarcode 
   



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