Retention Policies — Concept Check
Questions on Retention Policies. retention.ms and retention.bytes control time- and size-based log retention; set per-topic based on replay requirements and storage budget.
Questions in this quiz
8 questions on Retention Policies — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A Kafka topic is configured with retention.ms set to 86400000 and retention.bytes set to 10737418240. What happens if the topic reaches 10 GB before 24 hours?
- ALog compaction is triggered.
- BMessages are offloaded to object storage.
- CThe topic stops accepting new messages.
- DThe oldest log segments are deleted.
2.You have a Kafka topic with log.cleanup.policy set to 'compact'. What will happen if a key is updated multiple times?
- AMessages are retained until retention.bytes is exceeded.
- BAll messages per key are retained indefinitely.
- COnly the latest message per key is retained.
- DAll messages are deleted after retention.ms.
3.A Kafka broker has log.retention.ms set to 604800000. What does this configuration mean?
- ALogs are retained for 1 day.
- BLogs are retained for 30 days.
- CLogs are retained for 7 days.
- DLogs are retained indefinitely.
4.You observe that a Kafka topic with log.cleanup.policy set to 'compact,delete' is losing old messages faster than expected. What could be the cause?
- ALog.segment.bytes is too large.
- BRetention.bytes is unlimited.
- CRetention.ms is set too low.
- DMin.cleanable.dirty.ratio is too high.
5.A Kafka topic's retention.bytes is set to -1. What does this imply about the topic's storage?
- AThe topic will compact messages aggressively.
- BThe topic is not limited by size.
- CThe topic will delete messages immediately.
- DThe topic is limited to 1 GB.
6.A developer uses kafka-configs.sh to set retention.ms to 0 on a topic. What is the effect?
- AMessages are retained indefinitely.
- BMessages are offloaded to tiered storage.
- CLog compaction is enabled.
- DMessages are deleted immediately after being written.
7.A Kafka topic is configured with cleanup.policy set to 'compact'. What happens if a tombstone record is produced?
- AThe topic stops accepting new messages.
- BThe log is compacted immediately.
- CThe key is deleted from the log.
- DThe retention.ms setting is ignored.
8.A topic's retention.ms is set to 172800000, but messages are still present after 2 days. Why might this occur?
- ALog.segment.ms is too high.
- BThe topic is configured with tiered storage.
- CThe topic uses log compaction.
- DRetention.bytes has not been exceeded.