Skip to content

KAFKA-2409; have KafkaConsumer.committed return null when there is no commit#243

Closed
hachikuji wants to merge 1 commit into
apache:trunkfrom
hachikuji:KAFKA-2409
Closed

KAFKA-2409; have KafkaConsumer.committed return null when there is no commit#243
hachikuji wants to merge 1 commit into
apache:trunkfrom
hachikuji:KAFKA-2409

Conversation

@hachikuji

Copy link
Copy Markdown
Contributor

No description provided.

@onurkaraman

Copy link
Copy Markdown
Contributor

LGTM

@asfbot

asfbot commented Sep 25, 2015

Copy link
Copy Markdown

kafka-trunk-git-pr #553 SUCCESS
This pull request looks good

@asfgit asfgit closed this in 7e453df Sep 25, 2015
@guozhangwang

Copy link
Copy Markdown
Contributor

LGTM.

wyuka pushed a commit to wyuka/kafka that referenced this pull request Jan 21, 2022
…the RequestHandler threads and fetcher threads (apache#231)" (apache#243)

This reverts commit a34a489.
During certification, we found that this change is not safe.
For example, suppose follower 0 is currently fetching data for partition tp0 from leader 1,
and we are trying to switch the leadership to leader 2.

In the previous implementation, tp0 goes through the following steps
1. tp0 is removed from the fetcher targeting leader 1,
2. retrieving the fetch offset based on the new leader's epoch. Say leader 2 returns a fetch offset of 100.
3. tp0 is added to a new fetcher thread with the fetch offset of 100.

After the PR, the following race condition may happen
1. tp0 retrieves the fetch offset, e.g. 100, from leader 2
2. tp0 is concurrently sent for removal from the fetcher-with-leader-1
   and add to the fetcher-with-leader-2 with a fetch offset of 100.

Before the removal from fetcher-with-leader-1 is processed, more data may
possibly be retrieved from leader 1 and appended to the log (e.g. making the log end offset to become 102).
Then the fetch offset, i.e. 100, would not match the log end offset, i.e. 102.
davide-armand pushed a commit to aiven/kafka that referenced this pull request Dec 1, 2025
jeqo pushed a commit to aiven/kafka that referenced this pull request Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants