shibd commented on code in PR #25310:
URL: https://github.com/apache/pulsar/pull/25310#discussion_r2940280735


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:
##########
@@ -1310,7 +1310,21 @@ public boolean trackDelayedDelivery(long ledgerId, long 
entryId, MessageMetadata
 
             
delayedDeliveryTracker.get().resetTickTime(topic.getDelayedDeliveryTickTimeMillis());
 
-            long deliverAtTime = msgMetadata.hasDeliverAtTime() ? 
msgMetadata.getDeliverAtTime() : -1L;
+            long deliverAtTime = -1L;

Review Comment:
   `trackDelayedDelivery()` runs when the dispatcher first reads the entry for 
delivery, not when the broker stores it. Recomputing `deliverAtTime` as 
`System.currentTimeMillis() + (clientDeliverAt - publishTime)` therefore 
restarts the full original delay at dispatch time. For example, a 
`deliverAfter(3m)` message that already sat in backlog for 2 minutes will be 
delayed for another 3 minutes here, instead of only the remaining 1 minute (or 
immediately if overdue). That changes delayed-delivery semantics and can 
over-delay backlog / recovery cases.



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