Kafka - Topics and PartitionsHow does Kafka behave if both retention.ms and retention.bytes are set, but retention.bytes is smaller than the actual data size?AKafka deletes messages only when both retention.ms and retention.bytes limits are exceededBKafka ignores retention.bytes and deletes messages only after retention.ms expiresCKafka increases retention.ms automatically to avoid data lossDKafka deletes oldest messages to keep size under retention.bytes regardless of retention.msCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand retention policy precedenceKafka deletes messages when either retention.ms or retention.bytes limit is reached.Step 2: Analyze behavior when size limit is smallerIf retention.bytes is smaller than data size, Kafka deletes oldest messages to keep size under limit.Final Answer:Kafka deletes oldest messages to keep size under retention.bytes regardless of retention.ms -> Option DQuick Check:Either limit triggers deletion = Kafka deletes oldest messages to keep size under retention.bytes regardless of retention.ms [OK]Quick Trick: Either time or size limit triggers deletion [OK]Common Mistakes:Thinking both limits must be exceededAssuming retention.ms overrides retention.bytesBelieving Kafka auto-adjusts retention.ms
Master "Topics and Partitions" in Kafka9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kafka Quizzes Consumers - Auto-commit vs manual commit - Quiz 7medium Kafka Basics and Event Streaming - Kafka installation and setup - Quiz 8hard Kafka Cluster Architecture - Controller broker - Quiz 7medium Producers - Producer retries and idempotency - Quiz 10hard Producers - Acknowledgment modes (acks=0, 1, all) - Quiz 2easy Producers - Producer retries and idempotency - Quiz 11easy Topics and Partitions - Topic creation - Quiz 5medium Topics and Partitions - Topic deletion and cleanup - Quiz 7medium Topics and Partitions - Partition ordering guarantees - Quiz 3easy Topics and Partitions - Topic deletion and cleanup - Quiz 10hard