Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-8171

callback needs to be null when addStopReplicaRequestForBrokers when replica state transits to offline

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • controller
    • None

    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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kehu kehu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: