Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ class ControllerBrokerRequestBatch(controller: KafkaController, stateChangeLogge
stopReplicaRequestMap.getOrElseUpdate(brokerId, Seq.empty[StopReplicaRequestInfo])
val v = stopReplicaRequestMap(brokerId)
stopReplicaRequestMap(brokerId) = v :+ StopReplicaRequestInfo(PartitionAndReplica(topicPartition, brokerId),
deletePartition, (r: AbstractResponse) => callback(r, brokerId))
deletePartition, if (callback != null) (r: AbstractResponse) => callback(r, brokerId) else null)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,11 @@ class ReplicaStateMachine(config: KafkaConfig,
replicaState.put(replica, OnlineReplica)
}
case OfflineReplica =>
// Set callback to null so that controller will send one grouped request instead of one request for
// each topic partition
validReplicas.foreach { replica =>
controllerBrokerRequestBatch.addStopReplicaRequestForBrokers(Seq(replicaId), replica.topicPartition,
deletePartition = false, (_, _) => ())
deletePartition = false, null)
}
val (replicasWithLeadershipInfo, replicasWithoutLeadershipInfo) = validReplicas.partition { replica =>
controllerContext.partitionLeadershipInfo.contains(replica.topicPartition)
Expand Down