You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/01/30 13:50:51 UTC

[GitHub] [pulsar] 315157973 commented on a change in pull request #9362: Support get topic applied policy for Retention

315157973 commented on a change in pull request #9362:
URL: https://github.com/apache/pulsar/pull/9362#discussion_r567248478



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -2025,7 +2025,7 @@ private boolean shouldTopicBeRetained() {
         long retentionTime = TimeUnit.MINUTES.toNanos(retentionPolicies.getRetentionTimeInMinutes());
         // Negative retention time means the topic should be retained indefinitely,
         // because its own data has to be retained
-        return retentionTime < 0 || (System.nanoTime() - lastActive) < retentionTime;
+        return retentionTime <= 0 || (System.nanoTime() - lastActive) < retentionTime;

Review comment:
       OK, the status will like this:
   null: not retained
   = 0: not retained
   <0: retained indefinitely
   > 0: retained as required
   




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

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