Bird
Raised Fist0

You have set log.retention.hours=168 in your Kafka broker config, but logs are not retained for 7 days as expected. What is a likely cause?

medium📝 Debug Q14 of Q15
Kafka - with Java/Python
You have set log.retention.hours=168 in your Kafka broker config, but logs are not retained for 7 days as expected. What is a likely cause?
AThe <code>log.retention.hours</code> value must be set in minutes
BThe <code>log.retention.bytes</code> setting is limiting retention by size
CKafka does not support retention configuration
DThe broker needs to be restarted for changes to take effect
Step-by-Step Solution
Solution:
  1. Step 1: Understand retention config interaction

    Kafka retention can be limited by time or size; size limit can override time.
  2. Step 2: Analyze options

    The log.retention.bytes setting is limiting retention by size correctly identifies size limit as a possible cause.
  3. Final Answer:

    The log.retention.bytes setting is limiting retention by size -> Option B
  4. Quick Check:

    Retention limited by size overrides time [OK]
Quick Trick: Check size limits when time-based retention seems ignored [OK]
Common Mistakes:
MISTAKES
  • Assuming retention.hours must be in minutes
  • Believing Kafka ignores retention settings
  • Forgetting to restart broker (not always needed)

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes