Kafka
  1. Kafka
  2. KAFKA-1365

Second Manual preferred replica leader election command always fails

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 0.8.1
    • Fix Version/s: 0.8.1.1
    • Component/s: controller, tools
    • Labels:
      None

      Description

      After running kafka-preferred-replica-election.sh once, a second run will fail with "Preferred replica leader election currently in progress for ...".

      The /admin/preferred_replica_election key is never deleted from ZooKeeper, because the "isTriggeredByAutoRebalance" parameter to onPreferredReplicaElection (https://github.com/apache/kafka/blob/0ffec142a991849833d9767be07e895428ccaea1/core/src/main/scala/kafka/controller/KafkaController.scala#L614) is used incorrectly. In the automatic case (https://github.com/apache/kafka/blob/0ffec142a991849833d9767be07e895428ccaea1/core/src/main/scala/kafka/controller/KafkaController.scala#L1119), it is set to false. In the manual case (https://github.com/apache/kafka/blob/0ffec142a991849833d9767be07e895428ccaea1/core/src/main/scala/kafka/controller/KafkaController.scala#L1266) the parameter is not passed, so it defaults to true.

      1. KAFKA-1365.patch
        1 kB
        Guozhang Wang

        Issue Links

          Activity

          Joel Koshy made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Joel Koshy made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Guozhang Wang made changes -
          Attachment KAFKA-1365.patch [ 12640515 ]
          Joel Koshy made changes -
          Link This issue is depended upon by KAFKA-1380 [ KAFKA-1380 ]
          Joel Koshy made changes -
          Fix Version/s 0.8.1.1 [ 12326539 ]
          Fix Version/s 0.8.2 [ 12326167 ]
          Joel Koshy made changes -
          Link This issue is depended upon by KAFKA-1380 [ KAFKA-1380 ]
          Joel Koshy made changes -
          Fix Version/s 0.8.2 [ 12326167 ]
          Fix Version/s 0.8.1.1 [ 12326539 ]
          Joel Koshy made changes -
          Link This issue is depended upon by KAFKA-1380 [ KAFKA-1380 ]
          Neha Narkhede made changes -
          Priority Major [ 3 ] Critical [ 2 ]
          Neha Narkhede made changes -
          Fix Version/s 0.8.1.1 [ 12326539 ]
          Fix Version/s 0.8.2 [ 12326167 ]
          Neha Narkhede made changes -
          Fix Version/s 0.8.2 [ 12326167 ]
          Ryan Berdeen made changes -
          Description After running kafka-preferred-replica-election.sh once, a second run will fail with "Preferred replica leader election currently in progress for ...".

          The /admin/preferred_replica_election key is never deleted from ZooKeeper, because the "isTriggeredByAutoRebalance" parameter to onPreferredReplicaElection ([KafkaController.scala:614|https://github.com/apache/kafka/blob/0ffec142a991849833d9767be07e895428ccaea1/core/src/main/scala/kafka/controller/KafkaController.scala#L614]) is used incorrectly. In the automatic case ([KafkaController.scala:1119|https://github.com/apache/kafka/blob/0ffec142a991849833d9767be07e895428ccaea1/core/src/main/scala/kafka/controller/KafkaController.scala#L1119]), it is set to false. In the manual case ([KafkaController.scala:1266|https://github.com/apache/kafka/blob/0ffec142a991849833d9767be07e895428ccaea1/core/src/main/scala/kafka/controller/KafkaController.scala#L1266]) the parameter is not passed, so it defaults to true.
          After running kafka-preferred-replica-election.sh once, a second run will fail with "Preferred replica leader election currently in progress for ...".

          The /admin/preferred_replica_election key is never deleted from ZooKeeper, because the "isTriggeredByAutoRebalance" parameter to onPreferredReplicaElection (https://github.com/apache/kafka/blob/0ffec142a991849833d9767be07e895428ccaea1/core/src/main/scala/kafka/controller/KafkaController.scala#L614) is used incorrectly. In the automatic case (https://github.com/apache/kafka/blob/0ffec142a991849833d9767be07e895428ccaea1/core/src/main/scala/kafka/controller/KafkaController.scala#L1119), it is set to false. In the manual case (https://github.com/apache/kafka/blob/0ffec142a991849833d9767be07e895428ccaea1/core/src/main/scala/kafka/controller/KafkaController.scala#L1266) the parameter is not passed, so it defaults to true.
          Ryan Berdeen made changes -
          Field Original Value New Value
          Description After running kafka-preferred-replica-election.sh once, a second run will fail with "Preferred replica leader election currently in progress for ...".

          The /admin/preferred_replica_election key is never deleted from ZooKeeper, because the "isTriggeredByAutoRebalance" parameter to onPreferredReplicaElection (https://github.com/apache/kafka/blob/0ffec142a991849833d9767be07e895428ccaea1/core/src/main/scala/kafka/controller/KafkaController.scala#L614) is used incorrectly. In the automatic case (https://github.com/apache/kafka/blob/0ffec142a991849833d9767be07e895428ccaea1/core/src/main/scala/kafka/controller/KafkaController.scala#L1119), it is set to false. In the manual case (https://github.com/apache/kafka/blob/0ffec142a991849833d9767be07e895428ccaea1/core/src/main/scala/kafka/controller/KafkaController.scala#L1266) the parameter is not passed, so it defaults to true.
          After running kafka-preferred-replica-election.sh once, a second run will fail with "Preferred replica leader election currently in progress for ...".

          The /admin/preferred_replica_election key is never deleted from ZooKeeper, because the "isTriggeredByAutoRebalance" parameter to onPreferredReplicaElection ([KafkaController.scala:614|https://github.com/apache/kafka/blob/0ffec142a991849833d9767be07e895428ccaea1/core/src/main/scala/kafka/controller/KafkaController.scala#L614]) is used incorrectly. In the automatic case ([KafkaController.scala:1119|https://github.com/apache/kafka/blob/0ffec142a991849833d9767be07e895428ccaea1/core/src/main/scala/kafka/controller/KafkaController.scala#L1119]), it is set to false. In the manual case ([KafkaController.scala:1266|https://github.com/apache/kafka/blob/0ffec142a991849833d9767be07e895428ccaea1/core/src/main/scala/kafka/controller/KafkaController.scala#L1266]) the parameter is not passed, so it defaults to true.
          Ryan Berdeen created issue -

            People

            • Assignee:
              Neha Narkhede
              Reporter:
              Ryan Berdeen
            • Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development