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
|
* A retention size of 0, will make data to be deleted immediately. |
|
* <p> |
|
* A retention size of -1, means to have an unlimited retention size. |
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
Related issue
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
pulsar/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerConfig.java
Lines 415 to 417 in 22b8923
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
Related issue