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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/MessageDeduplication.java:
##########
@@ -323,6 +326,19 @@ public MessageDupStatus isDuplicate(PublishContext 
publishContext, ByteBuf heade
 
         String producerName = publishContext.getProducerName();
         long sequenceId = publishContext.getSequenceId();
+        // The process of the Producer sending chunk messages is continuous, 
and all chunks of a message use the same
+        // message metadata and sequence ID. Therefore, it is only necessary 
to check if the sequence ID of the first
+        // chunk is duplicated.
+        // When we receive the initial message of a non-duplicated chunk 
message, we place it in the
+        // chunkMessageOngoing. Upon completion of sending this chunk message, 
if we receive other messages
+        // sent by this Producer, we will remove it from the 
chunkMessageOngoing.
+        if (chunkMessageOngoing.containsKey(producerName)) {
+            if (publishContext.isChunked() && 
chunkMessageOngoing.get(producerName).equals(sequenceId)) {
+                return MessageDupStatus.NotDup;

Review Comment:
   Fixed.



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