wolfstudy commented on code in PR #15628:
URL: https://github.com/apache/pulsar/pull/15628#discussion_r874937182


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageExpiryMonitor.java:
##########
@@ -75,6 +75,18 @@ public boolean expireMessages(int messageTTLInSeconds) {
 
             
cursor.asyncFindNewestMatching(ManagedCursor.FindPositionConstraint.SearchActiveEntries,
 entry -> {
                 try {
+                    // When the time of the delayed message is greater than 
the time specified by TTL, we should
+                    // give up checking the TTL of the current delayed 
message, because the time of the delayed
+                    // message has not yet arrived, we cannot delete these 
messages.
+                    long delayTime = 
MessageImpl.getDelayTime(entry.getDataBuffer());

Review Comment:
   Yes, it is required here because the delay time can only be obtained from 
the entry. Similar to getting the property of publish time, we can only parse 
the current entry to get the corresponding delay time to diff whether it needs 
to expire. `MessageImpl.isEntryExpired` just passes the publish time parsed 
from the entry into the method of `MessageImpl.isEntryExpired`, and there is no 
way to reduce the parsing of the entry



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