lhotari opened a new issue #8345:
URL: https://github.com/apache/pulsar/issues/8345


   **Describe the bug**
   
   Currently it's easy to misunderstand how retention policy should be 
configured. Both size and time should be set. 
   It's easy to do mistakes in the configuration. If one sets time to some 
value and sets size to 0, this will lead to the situation where there is no 
retention.
   
   
https://pulsar.apache.org/docs/en/2.6.1/cookbooks-retention-expiry/#set-retention-policy
 doesn't explicitly document the meaning of 0 and -1. There's an example, but 
no explicit documentation like there is in the Javadoc at 
https://github.com/apache/pulsar/blob/22b8923a251c3356401090dacb8ff97fd37d14c1/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerConfig.java#L415-L417
 
   
   In the documentation there is a sentence "*Retention policies are either a 
size limit or a time limit.*" . This seems to be wrong since the limit is 
always based on both size and time. There's also a sentence "*It is also 
possible to set unlimited retention time or size by setting -1 for either time 
or size retention.*" (these sentences are in the cookbook's "Retention 
Policies" section 
https://pulsar.apache.org/docs/en/2.6.1/cookbooks-retention-expiry/#retention-policies).
 
   This sentence is also misleading since it says "*by setting -1 for either 
time or size retention*". 
   For completely unlimited retention, both values have to be set to -1.
   
   **Expected behavior**
   
   Retention policy is documented in a clear and accurate way.
   
   **Additional context**
   
   * https://apache-pulsar.slack.com/archives/C5Z4T36F7/p1603326655482900
   
   **Related issue**
   
   * #655
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to