You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Andras Katona (Jira)" <ji...@apache.org> on 2020/03/13 13:32:00 UTC

[jira] [Updated] (KAFKA-7908) retention.ms and message.timestamp.difference.max.ms are tied

     [ https://issues.apache.org/jira/browse/KAFKA-7908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andras Katona updated KAFKA-7908:
---------------------------------
    Fix Version/s: 2.3.0

> retention.ms and message.timestamp.difference.max.ms are tied
> -------------------------------------------------------------
>
>                 Key: KAFKA-7908
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7908
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.1.0
>            Reporter: Ciprian Pascu
>            Priority: Minor
>             Fix For: 2.3.0
>
>
> When configuring retention.ms for a topic, following warning will be printed:
> _retention.ms for topic X is set to 1800000. It is smaller than message.timestamp.difference.max.ms's value 9223372036854775807. This may result in frequent log rolling. (kafka.log.Log)_
>  
> message.timestamp.difference.max.ms has not been configured explicitly, so it has the default value of 9223372036854775807; I haven't seen anywhere mentioned that this parameter needs to be configured also, if retention.ms is configured; also, if we look at the default values for these parameters, they are also so, that retention.ms < message.timestamp.difference.max.ms; so, what is the purpose of this warning, in this case?
> The warning is generated from this code (core/src/main/scala/kafka/log/Log.scala):
>   _def updateConfig(updatedKeys: Set[String], newConfig: LogConfig): Unit = {_
>     _*if ((updatedKeys.contains(LogConfig.RetentionMsProp)*_
>       *_|| updatedKeys.contains(LogConfig.MessageTimestampDifferenceMaxMsProp))_*
>       _&& topicPartition.partition == 0  // generate warnings only for one partition of each topic_
>       _&& newConfig.retentionMs < newConfig.messageTimestampDifferenceMaxMs)_
>       _warn(s"${LogConfig.RetentionMsProp} for topic ${topicPartition.topic} is set to ${newConfig.retentionMs}. It is smaller than " +_
>         _s"${LogConfig.MessageTimestampDifferenceMaxMsProp}'s value ${newConfig.messageTimestampDifferenceMaxMs}. " +_
>         _s"This may result in frequent log rolling.")_
>     _this.config = newConfig_
>   _}_
>  
> Shouldn't the || operand in the bolded condition be replaced with &&?
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)