[ https://issues.apache.org/jira/browse/KAFKA-12485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17716307#comment-17716307 ]
Manyanda Chitimbo commented on KAFKA-12485: ------------------------------------------- Hi [~ableegoldman] I am current looking at this and I've a question regarding this part > We should consider optimizing these APIs to just return the cached offsets in > place of the remote call when passed in only partitions that are currently > owned. The requirement to return cached offset is that all partitions in the arg of Consumer#committed have to be owned or that we returned a cached offset for any partition in that list that's current owned, if a partition is not owned we fetch it via a remote call. I am taking the later approach but I'd like to confirm this with you. What do you think? > Speed up Consumer#committed by returning cached offsets for owned partitions > ---------------------------------------------------------------------------- > > Key: KAFKA-12485 > URL: https://issues.apache.org/jira/browse/KAFKA-12485 > Project: Kafka > Issue Type: Improvement > Components: consumer > Reporter: A. Sophie Blee-Goldman > Assignee: Manyanda Chitimbo > Priority: Major > Labels: newbie++ > > All of the KafkaConsumer#committed APIs will currently make a remote blocking > call to the server to fetch the committed offsets. This is typically used to > reset the offsets after a crash or restart, or to fetch offsets for other > consumers in the group. However some users may wish to invoke this API on > partitions which are currently owned by the Consumer, in which case the > remote call is unnecessary since it should be able to just keep track of what > it has itself committed. > We should consider optimizing these APIs to just return the cached offsets in > place of the remote call when passed in only partitions that are currently > owned. This is similar to what we do in Consumer#position, although there we > have a guarantee that the partitions are owned by the Consumer whereas in > #committed we do not -- This message was sent by Atlassian Jira (v8.20.10#820010)