hachikuji commented on code in PR #13107:
URL: https://github.com/apache/kafka/pull/13107#discussion_r1073904486


##########
core/src/main/scala/kafka/server/ReplicaManager.scala:
##########
@@ -390,7 +390,7 @@ class ReplicaManager(val config: KafkaConfig,
               // epoch, a sentinel value (NoEpoch) is used and bypass the 
epoch validation.
               if (requestLeaderEpoch == LeaderAndIsr.EpochDuringDelete ||
                   requestLeaderEpoch == LeaderAndIsr.NoEpoch ||
-                  requestLeaderEpoch > currentLeaderEpoch) {
+                  requestLeaderEpoch >= currentLeaderEpoch) {

Review Comment:
   I think the main thing is that a new reassignment will always have a leader 
epoch bump, so we are still ensured that the `StopReplica` cannot be reordered. 
It is still possible to have a stray replica though if the `StopReplica` from a 
cancellation is received before the initial `LeaderAndIsr` when the 
reassignment began. A better fix would be to bump the epoch after cancellation, 
but I didn't see a really simple way to do that.



-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to