Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

hachikuji
Copy link
Contributor

No description provided.

@onurkaraman
Copy link
Contributor

LGTM

@asfbot
Copy link

asfbot commented Sep 25, 2015

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

@asfgit asfgit closed this in 7e453df Sep 25, 2015
@guozhangwang
Copy link
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants