Ciprian Pascu created KAFKA-7908:
------------------------------------
Summary: 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
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
(v7.6.3#76005)