The consumer property auto.offset.reset applies only when no committed offset exists or the committed offset is invalid (e.g., below the log start offset).
However, if an offset is within the valid log range (even if the actual message was removed due to compaction), it is considered valid, and auto.offset.reset is not used.
From Kafka documentation:
“If the consumer’s committed offset is still within the range of the log, even if the message was compacted away, it will be respected.”
Explanation of options:
A, B, C → All scenarios where auto.offset.reset would apply.
D → Correct: Offset is valid even though the message is gone.
Page Reference:
Kafka: The Definitive Guide, 1st Edition, Chapter 6, p. 199
Apache Kafka Documentation: Consumer Configs – auto.offset.reset
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾