You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "kehu (JIRA)" <ji...@apache.org> on 2019/03/28 17:24:00 UTC
[jira] [Updated] (KAFKA-8171) callback needs to be null when
addStopReplicaRequestForBrokers when replica state transits to offline
[ https://issues.apache.org/jira/browse/KAFKA-8171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
kehu updated KAFKA-8171:
------------------------
Description:
Problem:
In ControllerChannelManager.sendRequestsToBrokers, for STOP_REPLICA requests, it will try to group the requests based on deletePartition flag and callback:
val (replicasToGroup, replicasToNotGroup) = replicaInfoList.partition(r => !r.deletePartition && r.callback == null)
When both conditions meet, controller is expected to send only one request to destination broker. However, when adding the requests in ReplicaStateMachine, it's putting in non-null callback (_,_)=>(). Therefore, replicasToGroup is always empty and controller will always first sends an empty request followed by #partitions requests.
Fix: set the callback to null in addStopReplicaRequestForBrokers when replica state transits to offline. PR has been created: https://github.com/apache/kafka/pull/6515
was:
Problem:
In ControllerChannelManager.sendRequestsToBrokers, for STOP_REPLICA requests, it will try to group the requests based on deletePartition flag and callback:
val (replicasToGroup, replicasToNotGroup) = replicaInfoList.partition(r => !r.deletePartition && r.callback == null)
When both conditions meet, controller is expected to send only one request to destination broker. However, when adding the requests in ReplicaStateMachine, it's putting in non-null callback (_,_)=>(). Therefore, replicasToGroup is always empty and controller will always first sends an empty request followed by #partitions requests.
Fix: set the callback to null in addStopReplicaRequestForBrokers when replica state transits to offline.
> callback needs to be null when addStopReplicaRequestForBrokers when replica state transits to offline
> -----------------------------------------------------------------------------------------------------
>
> Key: KAFKA-8171
> URL: https://issues.apache.org/jira/browse/KAFKA-8171
> Project: Kafka
> Issue Type: Bug
> Components: controller
> Reporter: kehu
> Priority: Major
>
> Problem:
> In ControllerChannelManager.sendRequestsToBrokers, for STOP_REPLICA requests, it will try to group the requests based on deletePartition flag and callback:
> val (replicasToGroup, replicasToNotGroup) = replicaInfoList.partition(r => !r.deletePartition && r.callback == null)
> When both conditions meet, controller is expected to send only one request to destination broker. However, when adding the requests in ReplicaStateMachine, it's putting in non-null callback (_,_)=>(). Therefore, replicasToGroup is always empty and controller will always first sends an empty request followed by #partitions requests.
>
> Fix: set the callback to null in addStopReplicaRequestForBrokers when replica state transits to offline. PR has been created: https://github.com/apache/kafka/pull/6515
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)