Skip to content

[Documentation] Retention policy documentation is misleading and not accurate #8345

Description

@lhotari

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    docYour PR contains doc changes, no matter whether the changes are in markdown or code files.type/bugThe PR fixed a bug or issue reported a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions