poorbarcode commented on code in PR #24622:
URL: https://github.com/apache/pulsar/pull/24622#discussion_r2271917303
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -2118,19 +2119,78 @@ private CompletableFuture<Void>
checkShadowReplication() {
@Override
public void checkMessageExpiry() {
int messageTtlInSeconds = topicPolicies.getMessageTTLInSeconds().get();
- if (messageTtlInSeconds != 0) {
+ if (messageTtlInSeconds <= 0) {
+ return;
+ }
+
+ ManagedLedger managedLedger = getManagedLedger();
+ if (managedLedger instanceof ManagedLedgerImpl ml) {
+ checkMessageExpiryWithSharedPosition(ml, messageTtlInSeconds);
+ } else {
+ // Fallback to the slower solution if managed ledger is not an
instance of ManagedLedgerImpl: each
+ // subscription find position and handle expiring itself.
+ checkMessageExpiryWithoutSharedPosition(messageTtlInSeconds);
+ }
Review Comment:
NO, we do not have
--
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]