hachikuji commented on pull request #9441: URL: https://github.com/apache/kafka/pull/9441#issuecomment-709432283
@tombentley Thanks for the patch. I think the problem is in the callback inside `KafkaApis.handleLeaderAndIsrRequest`. With two concurrent `LeaderAndIsr` requests, there is no guarantee about the ordering of the callbacks even though `ReplicaManager` checks epoch. They can get reordered like the following: 1. Call `ReplicaManager.becomeLeaderOrFollower` with epoch=1 in thread 1 2. Call `ReplicaManager.becomeLeaderOrFollower` with epoch=2 in thread 2 3. Call `onLeadershipChange` callback in thread 2 4. Call `onLeadershipChange` callback in thread 1 At least that's my understanding of the issue. I think we need to find a way to push the epoch validation into `GroupCoordinator`. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org