You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "xrayw (via GitHub)" <gi...@apache.org> on 2024/01/01 15:33:45 UTC

Re: [PR] Fixed key-shared delivery of messages with interleaved delays [pulsar]

xrayw commented on code in PR #15409:
URL: https://github.com/apache/pulsar/pull/15409#discussion_r1313299436


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:
##########
@@ -270,7 +270,11 @@ public synchronized void readMoreEntries() {
                             consumerList.size());
                 }
                 havePendingRead = true;
-                minReplayedPosition = getMessagesToReplayNow(1).stream().findFirst().orElse(null);
+                Set<PositionImpl> toReplay = getMessagesToReplayNow(1);
+                minReplayedPosition = toReplay.stream().findFirst().orElse(null);
+                if (minReplayedPosition != null) {
+                    redeliveryMessages.add(minReplayedPosition.getLedgerId(), minReplayedPosition.getEntryId());

Review Comment:
   Hi, Merli. I'm a little confused here, we get position by `getMessagesToReplayNow`, the returned positions not deleted in `getMessagesToReplayNow`, so why we need to add it to `redeliveryMessages` again? thank you



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org