0

How can I flush the __consumer_offsets topic?

Are there best practices for this topic?

I have just set the offsets.retention.minutes=1, restarted the broker, checked in the log that offsets.retention.minutes=1 but the size of the 50 partitions of the __consumer_offsets topic is still the same.

Why?

xRobot
  • 25,579
  • 69
  • 184
  • 304
  • That setting doesn't immediately take affect. You need to wait for the log cleaner thread to start. Do you only have one broker, though? – OneCricketeer May 19 '21 at 13:22
  • @OneCricketeer 2 brokers. Are there best practices to flush that topic? thanks :) – xRobot May 19 '21 at 13:43
  • AFAIK, "best practice" says to leave it alone outside of a development environment. You'd need to modify the properties of both brokers, but that's not how you actual modify that topics retention settings, since that setting only applies if the topic doesn't exist (when it's first created). You'd use `kafka-topics` command like any other topic to modify its retention period – OneCricketeer May 19 '21 at 13:47

1 Answers1

1

offsets.retention.minutes only applies when __consumer_offsets doesn't exist already.

You'd change the retention like any other topic, going forward - Purge Kafka Topic, however "best practice" says to leave the topic alone and let the LogCleaner handle removing old consumer groups

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245