CCDAK · Question #138
Compaction is enabled for a topic in Kafka by setting log.cleanup.policy=compact. What is true about log compaction?
The correct answer is D. After cleanup, only one message per key is retained with the latest value Compaction changes. Log compaction retains at least the last known value for each record key for a single topic partition. All compacted log offsets remain valid, even if record at offset has been compacted away as a consumer will get the next highest offset.
Question
Compaction is enabled for a topic in Kafka by setting log.cleanup.policy=compact. What is true about log compaction?
Options
- AAfter cleanup, only one message per key is retained with the first value
- BEach message stored in the topic is compressed
- CKafka automatically de-duplicates incoming messages based on key hashes
- DAfter cleanup, only one message per key is retained with the latest value Compaction changes
How the community answered
(50 responses)- A2% (1)
- B6% (3)
- C2% (1)
- D90% (45)
Explanation
Log compaction retains at least the last known value for each record key for a single topic partition. All compacted log offsets remain valid, even if record at offset has been compacted away as a consumer will get the next highest offset.
Topics
Community Discussion
No community discussion yet for this question.