You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Apurva Mehta (JIRA)" <ji...@apache.org> on 2017/05/18 00:11:04 UTC

[jira] [Created] (KAFKA-5273) KafkaConsumer.committed() should get latest committed offsets from the server

Apurva Mehta created KAFKA-5273:
-----------------------------------

             Summary: KafkaConsumer.committed() should get latest committed offsets from the server
                 Key: KAFKA-5273
                 URL: https://issues.apache.org/jira/browse/KAFKA-5273
             Project: Kafka
          Issue Type: Sub-task
            Reporter: Apurva Mehta


Currently, the `KafkaConsumer.committed(topicPartition)` will return the current position of the consumer for that partition if the consumer has been assigned the partition. Otherwise, it will lookup the committed position from the server. 

With the new producer `sendOffsetsToTransaction` api, we get into a state where we can commit the offsets for an assigned partition through the producer. So the consumer doesn't update it's cached view and subsequently returns a stale committed offset for it's assigned partition. 

We should either update the consumer's cache when offsets are committed through the producer, or drop the cache totally and always lookup the server to get the committed offset. This way the `committed` method will always return the latest committed offset for any partition.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)