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

Avoid unnecessary loop iteration in leastLoadedNode

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: None
    • Component/s: network
    • Labels:
      None

      Description

      In NetworkClient.leastLoadedNode, it invokes `isReady` to  check if an established connection exists for the given node. `isReady` checks whether metadata needs to be updated also which wants to make metadata request first priority. However, if the to-be-sent request is metadata request, then we do not have to check this otherwise the loop in `leastLoadedNode` will do a complete iteration until the final node is selected. That's not performance efficient for a large cluster.

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                huxi_2b huxihx
                Reporter:
                huxi_2b huxihx
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: