KAFKA-9645: Fallback to unsubscribe during Task Migrated#8220
KAFKA-9645: Fallback to unsubscribe during Task Migrated#8220guozhangwang merged 3 commits intoapache:trunkfrom
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
ableegoldman
left a comment
There was a problem hiding this comment.
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 |
guozhangwang
left a comment
There was a problem hiding this comment.
LGTM! After green build I will merge to trunk.
| } | ||
|
|
||
| // needed for cases where you make a second call to endOffsets | ||
| public synchronized void addEndOffsets(final Map<TopicPartition, Long> newOffsets) { |
|
|
||
| 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.
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.
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)