Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-4815 Idempotent/transactional Producer (KIP-98)
  3. KAFKA-5273

KafkaConsumer.committed() should get latest committed offsets from the server

Attach filesAttach ScreenshotVotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            apurva Apurva Mehta
            apurva Apurva Mehta
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment