Difference between delete.retention.ms and retention.ms

Hello!
I’m seeing ambiguous information on the actual meaning of these two topic properties.
Which is responsible for the actual retention time in a topic, i.e. for how long the messages are stored?
Thank you,
David

The delete.retention.ms property dictates how long to retain tombstones (special messages with null value signifying deletion) in compacted topics, while retention.ms dictates how long to retain “regular” (non-tombstone) messages in topics that have the delete cleanup.policy set.

The topic’s cleanup.policy dictates which property applies:

  • cleanup.policy = delete: only retention.ms applies
  • cleanup.policy = compact: only delete.retention.ms applies
  • cleanup.policy = delete,compact: both retention.ms and delete.retention.ms apply

Understood, thank you!