[ https://issues.apache.org/jira/browse/KAFKA-4415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15708613#comment-15708613 ]
Ismael Juma commented on KAFKA-4415: ------------------------------------ This is a good improvement, but I think the description is not completely accurate. We were sending O(brokerNum) requests, not O(partitionNum * brokerNum) as far as I can see: https://github.com/apache/kafka/blob/3b4c347949c02b1e2b1dd473deda0f8d2304d027/core/src/main/scala/kafka/controller/ControllerChannelManager.scala#L404 So, the improvement affects the memory usage and processing time, but not what was sent on the wire. If you agree, it would be good to update the description of the JIRA. > Reduce time to create and send MetadataUpdateRequest > ---------------------------------------------------- > > Key: KAFKA-4415 > URL: https://issues.apache.org/jira/browse/KAFKA-4415 > Project: Kafka > Issue Type: Bug > Affects Versions: 0.10.1.0 > Reporter: Dong Lin > Assignee: Dong Lin > Fix For: 0.10.1.1 > > > As of current implementation, when controller receives > ControlledShutdownRequest, it will 1) for every broker in the cluster, for > every partition on the broker which wants to shutdown, create an instance of > PartitionStateInfo and add it to > ControllerBrokerRequestBatch.,updateMetadataRequestMap; and 2) for every > broker, for every follower partitions on the broker which wants to shutdown, > send one MetadataUpdateRequst to that broker. > In order to shutdown a broker, the controller will need to instantiate > O(partitionNum * brokerNum) PartitionStateInfo and send O(partitionNum * > brokerNum) partitionStateInfo. This is not efficient. The broker should only > need to instantiate O(partitionNum) PartitionStateInfo and send O(brokerNum) > MetadataUpdateRequest. > Micro-benchmark results show that this optimization can reduce the time of > processing ControlledShutdownRequest by 30%. -- This message was sent by Atlassian JIRA (v6.3.4#6332)