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

Do not attempt to elect preferred leader replicas which are outside ISR

    XMLWordPrintableJSON

    Details

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

      Description

      The controller automatically triggers a preferred leader election every N minutes. It tries to elect all preferred leaders of partitions without doing some basic checks like whether the leader is in sync.

      This leads to a multitude of errors which cause confusion:

      April 14th 2020, 17:01:11.015	[Controller id=0] Partition TOPIC-9 failed to complete preferred replica leader election to 1. Leader is still 0
      April 14th 2020, 17:01:11.002	[Controller id=0] Error completing replica leader election (PREFERRED) for partition TOPIC-9
      kafka.common.StateChangeFailedException: Failed to elect leader for partition TOPIC-9 under strategy PreferredReplicaPartitionLeaderElectionStrategy 

      It would be better if the Controller filtered out some of these elections, not attempt them at all and maybe log an aggregate INFO-level log

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gw524119574 Wang Ge
                Reporter:
                enether Stanislav Kozlovski
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: