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

Fetch from follower should never run the preferred read replica selection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.6.0
    • 3.3.0
    • core
    • None

    Description

      The design purpose of the code is that only the leader broker can determine the preferred read-replica.

       

      readFromLocalLog()
      ....
      // If we are the leader, determine the preferred read-replica
      val preferredReadReplica = clientMetadata.flatMap(
        metadata => findPreferredReadReplica(partition, metadata, replicaId, fetchInfo.fetchOffset, fetchTimeMs)) 

       

      But in fact, since the broker does not judge whether it is the leader or not, the follower will also execute the preferred read-replica selection.

      partition.leaderReplicaIdOpt.flatMap { leaderReplicaId =>
        // Don't look up preferred for follower fetches via normal replication and
        if (Request.isValidBrokerId(replicaId))
          None
        else { 

      Attachments

        Issue Links

          Activity

            People

              ZhaoBo03 zhaobo
              ZhaoBo03 zhaobo
              David Jacot David Jacot
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: