Andrew Schofield created KAFKA-19875:
----------------------------------------

             Summary: Duplicated topic config prevents broker start
                 Key: KAFKA-19875
                 URL: https://issues.apache.org/jira/browse/KAFKA-19875
             Project: Kafka
          Issue Type: Bug
    Affects Versions: 4.2.0
            Reporter: Andrew Schofield


KIP-1161 tightened the validation of configurations. Unfortunately, there is a 
situation in which the tighter validation introduces a blocking issue for AK 
4.2.

If I create a broker in AK 4.1 and then create a topic with a duplicated value 
for the cleanup.policy config, the broker will not start with the AK 4.2 code.

Here's an example of the topic creation which fails:

$ bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --topic T1 
--config cleanup.policy=delete,delete

And here's the exception stack trace from the 4.2 broker failing to start:

[2025-11-10 09:14:28,730] ERROR Encountered fatal fault: Error starting 
LogManager (org.apache.kafka.server.fault.ProcessTerminatingFaultHandler)

org.apache.kafka.common.config.ConfigException: Configuration 'cleanup.policy' 
values must not be duplicated.

at 
org.apache.kafka.common.config.ConfigDef$ValidList.ensureValid(ConfigDef.java:1050)

at org.apache.kafka.common.config.ConfigDef.parseValue(ConfigDef.java:540)

at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:524)

at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:118)

at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:149)

at org.apache.kafka.storage.internals.log.LogConfig.<init>(LogConfig.java:299)

at 
org.apache.kafka.storage.internals.log.LogConfig.fromProps(LogConfig.java:426)

at 
kafka.log.LogManager.$anonfun$fetchTopicConfigOverrides$1(LogManager.scala:590)

at 
kafka.log.LogManager.$anonfun$fetchTopicConfigOverrides$1$adapted(LogManager.scala:586)

at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:630)

at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:628)

at scala.collection.AbstractIterable.foreach(Iterable.scala:936)

at kafka.log.LogManager.fetchTopicConfigOverrides(LogManager.scala:586)

at kafka.log.LogManager.startup(LogManager.scala:579)

at 
kafka.server.metadata.BrokerMetadataPublisher.initializeManagers(BrokerMetadataPublisher.scala:344)

at 
kafka.server.metadata.BrokerMetadataPublisher.onMetadataUpdate(BrokerMetadataPublisher.scala:141)

at 
org.apache.kafka.image.loader.MetadataLoader.initializeNewPublishers(MetadataLoader.java:315)

at 
org.apache.kafka.image.loader.MetadataLoader.lambda$scheduleInitializeNewPublishers$0(MetadataLoader.java:272)

at 
org.apache.kafka.queue.KafkaEventQueue$EventContext.run(KafkaEventQueue.java:134)

at 
org.apache.kafka.queue.KafkaEventQueue$EventHandler.handleEvents(KafkaEventQueue.java:217)

at 
org.apache.kafka.queue.KafkaEventQueue$EventHandler.run(KafkaEventQueue.java:188)

at java.base/java.lang.Thread.run(Thread.java:1583)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to