Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
A stray replica is one that is left behind on a broker after the partition has been reassigned to other brokers or the partition has been deleted. We found one case where this can happen is after a cancelled reassignment. When a reassignment is cancelled, the controller sends `StopReplica` requests to any of the adding replicas, but it does not necessarily bump the leader epoch. Following [KIP-570|https://cwiki.apache.org/confluence/display/KAFKA/KIP-570%3A+Add+leader+epoch+in+StopReplicaRequest,] brokers will ignore `StopReplica` requests if the leader epoch matches the current partition leader epoch. So we need to bump the epoch whenever we need to ensure that `StopReplica` will be received.