[ https://issues.apache.org/jira/browse/KAFKA-12485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17302980#comment-17302980 ]
A. Sophie Blee-Goldman edited comment on KAFKA-12485 at 3/17/21, 12:03 AM: --------------------------------------------------------------------------- Side note: if we get this optimization in then we should be able to skip the last (\?) followup for KIP-572: handling TimeoutExceptions thrown from the mainConsumer#committed call when reinitializing offsets for corrupted tasks in TaskManager#closeAndRevive. cc [~mjsax] was (Author: ableegoldman): Side note: if we get this optimization in then we should be able to skip the last (?) followup for KIP-572: handling TimeoutExceptions thrown from the mainConsumer#committed call when reinitializing offsets for corrupted tasks in TaskManager#closeAndRevive. cc [~mjsax] > 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 > 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.3.4#803005)