Affects Version/s: 2.0.1
Fix Version/s: None
Per https://kafka.apache.org/22/javadoc/index.html?org/apache/kafka/streams/KafkaStreams.html, the "position" offset is $latest_offset_customer_has_seem_from_poll + 1; i.e., it is the offset of the next message the consumer will see. If this is the case though, there would be a bug - both KafkaConsumer and MockConsumer on v2.2 and v2.0.1 (my version) have 'commitSync' methods that are:
This would mean that each commit actually commits one message per owned partition that the consumer has yet to see. This wouldn't be a problem under normal operation as the consumer would still get that message on its next poll, but if the consumer were to die between the commitSync and the next poll then it would restart and skip that message. This would be a pretty serious bug!
However, digging into SubscriptionState itself, I see:
Implying that the "position" offset is actually the last position returned to the user, which would make the bug only in MockConsumer which sets its subscriptions.position to be $highest_offset_seen + 1.
Which meaning do we expect "position" to be? And could there be any other bugs lurking due to the confusion?