-
Notifications
You must be signed in to change notification settings - Fork 14k
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-9645: Fallback to unsubscribe during Task Migrated #8220
Conversation
The issue is that when handling TaskMigrated, we call What I'm thinking now is, should we reset the assignment inside consumer when |
Thanks Guozhang for the summary, I think there is also an expectation around the |
3a1837a
to
8fa8bb3
Compare
Double checked with unit test that under old code path, we shall hit the reported exception:
|
8fa8bb3
to
23d6c66
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Boyang, this LGTM
Test this please |
test this please |
2 similar comments
test this please |
test this please |
23d6c66
to
d4c4425
Compare
test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! After green build I will merge to trunk.
@@ -356,21 +358,10 @@ public synchronized void seekToEnd(Collection<TopicPartition> partitions) { | |||
subscriptions.requestOffsetReset(partitions, OffsetResetStrategy.LATEST); | |||
} | |||
|
|||
// needed for cases where you make a second call to endOffsets | |||
public synchronized void addEndOffsets(final Map<TopicPartition, Long> newOffsets) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
|
||
EasyMock.verify(taskManager); | ||
|
||
// The Mock consumer shall throw as the assignment has been wiped out, but records are assigned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm :) it reminds me that the mock consumer's behavior is not exactly the same as the actual consumer (the later would filter, the former would throw), but perhaps this worth a different PR to cleanup. @abbccdda could you file a JIRA for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me! https://issues.apache.org/jira/browse/KAFKA-9679
test this please |
After #7312, we could still return data during the rebalance phase, which means it could be possible to find records without corresponding tasks. We have to fallback to the unsubscribe mode during task migrated as the assignment should be cleared out to keep sync with task manager state.
Committer Checklist (excluded from commit message)