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

KafkaController unnecessarily reads leaderAndIsr info from ZK

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 0.8.0
    • None
    • core

    Description

      KafkaController calls updateLeaderAndIsrCache() in onBrokerFailure(). This is unnecessary since in onBrokerFailure(), we will make leader and isr change anyway so there is no need to first read that information from ZK. Latency is critical in onBrokerFailure() since it determines how quickly a leader can be made online.

      Similarly, updateLeaderAndIsrCache() is called in onBrokerStartup() unnecessarily. In this case, the controller does not change the leader or the isr. It just needs to send the current leader and the isr info to the newly started broker. We already cache leader in the controller. Isr in theory could change any time by the leader. So, reading from ZK doesn't guarantee that we can get the latest isr anyway. Instead, we just need to get the isr last selected by the controller (which can be cached together with the leader in the controller). If the leader epoc in a broker is at or larger than the epoc in the leaderAndIsr request, the broker can just ignore it. Otherwise, the leader and the isr selected by the controller should be used.

      Attachments

        1. KAFKA-574-v4.patch
          32 kB
          Prashanth Menon
        2. KAFKA-574-v3.patch
          32 kB
          Prashanth Menon
        3. KAFKA-574-v2.patch
          30 kB
          Prashanth Menon
        4. KAFKA-574-v1.patch
          12 kB
          Prashanth Menon

        Activity

          People

            prashanth.menon Prashanth Menon
            junrao Jun Rao
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 48h
                48h
                Remaining:
                Remaining Estimate - 48h
                48h
                Logged:
                Time Spent - Not Specified
                Not Specified