From 33a5798fd898e73df86aba7edff0502ca970819b Mon Sep 17 00:00:00 2001 From: Dibyendu Bhattacharya Date: Thu, 20 Jun 2013 10:40:24 +0530 Subject: [PATCH] Update ReplicaStateMachine.scala KAFKA-948 When the broker which is the leader for a partition is down, the ISR list in the LeaderAndISR path is updated. But if the broker , which is not a leader of the partition is down, the ISR list is not getting updated. This is an issue because ISR list contains the stale entry. --- core/src/main/scala/kafka/controller/ReplicaStateMachine.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala b/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala index 4fbb28eca2888..556169c989c73 100644 --- a/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala +++ b/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala @@ -166,6 +166,7 @@ class ReplicaStateMachine(controller: KafkaController) extends Logging { case OfflineReplica => assertValidPreviousStates(topic, partition, replicaId, List(NewReplica, OnlineReplica), targetState) // As an optimization, the controller removes dead replicas from the ISR + updateLeaderAndIsrCache() val leaderAndIsrIsEmpty: Boolean = controllerContext.partitionLeadershipInfo.get(topicAndPartition) match { case Some(currLeaderIsrAndControllerEpoch) =>