You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Colin P. McCabe (JIRA)" <ji...@apache.org> on 2019/06/03 16:06:00 UTC
[jira] [Updated] (KAFKA-7703) KafkaConsumer.position may return a
wrong offset after "seekToEnd" is called
[ https://issues.apache.org/jira/browse/KAFKA-7703?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Colin P. McCabe updated KAFKA-7703:
-----------------------------------
Priority: Blocker (was: Major)
> KafkaConsumer.position may return a wrong offset after "seekToEnd" is called
> ----------------------------------------------------------------------------
>
> Key: KAFKA-7703
> URL: https://issues.apache.org/jira/browse/KAFKA-7703
> Project: Kafka
> Issue Type: Bug
> Components: clients
> Affects Versions: 2.3.0
> Reporter: Shixiong Zhu
> Assignee: Viktor Somogyi-Vass
> Priority: Blocker
> Fix For: 2.3.0
>
>
> After "seekToEnd" is called, "KafkaConsumer.position" may return a wrong offset set by another reset request.
> Here is a reproducer: https://github.com/zsxwing/kafka/commit/4e1aa11bfa99a38ac1e2cb0872c055db56b33246
> In this reproducer, "poll(0)" will send an "earliest" request in background. However, after "seekToEnd" is called, due to a race condition in "Fetcher.resetOffsetIfNeeded" (It's not atomic, "seekToEnd" could happen between the check https://github.com/zsxwing/kafka/commit/4e1aa11bfa99a38ac1e2cb0872c055db56b33246#diff-b45245913eaae46aa847d2615d62cde0R585 and the seek https://github.com/zsxwing/kafka/commit/4e1aa11bfa99a38ac1e2cb0872c055db56b33246#diff-b45245913eaae46aa847d2615d62cde0R605), "KafkaConsumer.position" may return an "earliest" offset.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)