You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "nandini (Jira)" <ji...@apache.org> on 2020/11/09 10:54:00 UTC
[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17228514#comment-17228514 ]
nandini commented on KAFKA-7908:
--------------------------------
This applies to older versions too. Just found this in 0.11.0. The *Affects Version/s:* needs to be updated.
> 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, 2.4.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)