nerdexam
Confluent

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.

Application Design

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)
  • A
    2% (1)
  • B
    6% (3)
  • C
    2% (1)
  • D
    90% (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

#log compaction#cleanup.policy=compact#message retention#key-based compaction

Community Discussion

No community discussion yet for this question.

Full CCDAK Practice