heesung-sn commented on code in PR #20948:
URL: https://github.com/apache/pulsar/pull/20948#discussion_r1302355578


##########
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
                 || msgMetadata.getChunkId() != 
(chunkedMsgCtx.lastChunkedMessageId + 1)) {
+            // Filter duplicated chunks instead of discard it.
+            if (chunkedMsgCtx == null || msgMetadata.getChunkId() <= 
chunkedMsgCtx.lastChunkedMessageId) {

Review Comment:
   I see.
   
   So you are handling the first part here, `chunk ID <= lastChunkedMessageId`, 
without stopping the current msg chunking.
   
    I see that you also emitted this chunk expire logic here. can you explain 
why?
   
   ```
    if (expireTimeOfIncompleteChunkedMessageMillis > 0
                       && System.currentTimeMillis() > 
(msgMetadata.getPublishTime()
                               + expireTimeOfIncompleteChunkedMessageMillis)) {
                   doAcknowledge(msgId, AckType.Individual, 
Collections.emptyMap(), null);
               } else {
                   trackMessage(msgId);
               }
   ```



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