You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Ray Chiang (JIRA)" <ji...@apache.org> on 2018/08/03 00:26:00 UTC
[jira] [Commented] (KAFKA-5687) Retention settings are inconsistent
between broker and topic
[ https://issues.apache.org/jira/browse/KAFKA-5687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16567628#comment-16567628 ]
Ray Chiang commented on KAFKA-5687:
-----------------------------------
I think there's a misreading in the docs here. The logic more or less works as follows.
1) If you need retention on a per-topic basis, use the retention.ms property on that topic.
2) If there is no retention value on a topic, then the broker uses the retention.ms property. Since it's a long, it can be set between 0 and Long.MaxValue (in ms).
3) If log.retention.ms is not set, the broker looks for the log.retention.minutes property.
4) If neither property is set in 3) above, then look at the log.retention.hours property.
So, as you can see, the properties override each other--the properties are not additive. If you need anything finer than 1 minute resolution, use the log.retention.ms property. Otherwise, you can find an equivalent value in ms, for example:
A) Setting log.retention.hours=168
B) Setting log.retention.minutes=10080 (i.e. 168*60)
C) Setting log.retention.ms=604800000 (i.e. 168*60*60*1000)
are all equivalent settings from the point of broker log retention (1 week).
> Retention settings are inconsistent between broker and topic
> ------------------------------------------------------------
>
> Key: KAFKA-5687
> URL: https://issues.apache.org/jira/browse/KAFKA-5687
> Project: Kafka
> Issue Type: Bug
> Components: log
> Reporter: Ivan Babrou
> Priority: Major
> Attachments: screenshot-1.png, screenshot-2.png
>
>
> Topic configurations:
> * retention.ms
> Broker configurations:
> * log.retention.hours
> * log.retention.minutes
> * log.retention.ms
> First of all, it's impossible to set topic retention time in hours or minutes. Second, "seconds" version is missing between "ms" and "minutes".
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)