Judy
Judy

Reputation: 1871

kafka-configs.sh + what is the configuration after retention.ms deletion on topic

On the following kafka topic syntax

kafka-topics.sh  --zookeeper zookeeper:2181 --describe --topics-with-overrides

we get :

Topic: __consumer_offsets       PartitionCount: 50      ReplicationFactor: 3    Configs: compression.type=producer,cleanup.policy=compact,min.insync.replicas=3,segment.bytes=104857600,retention.ms=7200000

We can see that retention.ms=18000000 ( its means that retention in mili second is 5 hours )

now we removed the retention.ms configuration by the following kafka cli

kafka-configs.sh --zookeeper zookeeper:2181 --alter --entity-type topics --entity-name __consumer_offsets       --delete-config retention.ms

and therefore we get

kafka-topics.sh  --zookeeper zookeeper:2181 --describe --topics-with-overrides

Topic: __consumer_offsets       PartitionCount: 50      ReplicationFactor: 3    Configs: compression.type=producer,cleanup.policy=compact,min.insync.replicas=3,segment.bytes=104857600

As we can see above retention.ms was removed

Now my Question is

  1. After we removed the retention.ms , what should be the new retention ? , is it means that kafka is looking now on kafka configuration file as - server.properties ?

  2. Second , what is the risks when we perform the kafka cli - kafka-configs.sh --zookeeper zookeeper:2181 --alter --entity-type topics --entity-name __consumer_offsets --delete-config retention.ms

Upvotes: 0

Views: 298

Answers (1)

OneCricketeer
OneCricketeer

Reputation: 191844

All topics have a retention, so there is no risk of removing the topic-override.

If the override is removed, then yes, it'll take the default, global retention from the broker server.properties

Note that you may see different values if you use --describe --bootstrap-servers kafka:9092

Upvotes: 1

Related Questions