Kafka
  1. Kafka
  2. KAFKA-785

Resolve bugs in PreferredReplicaLeaderElection admin tool

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.8.0
    • Fix Version/s: 0.8.0
    • Component/s: None
    • Labels:

      Description

      1. Since we run the preferred replica election on all partitions if the jsonFile is empty, the jsonFileOpt should not be checked in the code as a required option.
      2. We should not pass "" to Utils.readFileAsString
      3. KAFKA-780

      1. KAFKA-785.patch
        3 kB
        Sriram Subramanian
      There are no Sub-Tasks for this issue.

        Activity

        Hide
        Sriram Subramanian added a comment -

        1. Made partition input file optional for PreferredReplicaLeaderElectionCommand
        2. Removed shutdown hook from PreferredReplicaLeaderElectionCommand and ReassignPartitionsCommand as it was causing NPE and it was not useful since the operations on the controller are asynchronous.

        Show
        Sriram Subramanian added a comment - 1. Made partition input file optional for PreferredReplicaLeaderElectionCommand 2. Removed shutdown hook from PreferredReplicaLeaderElectionCommand and ReassignPartitionsCommand as it was causing NPE and it was not useful since the operations on the controller are asynchronous.
        Hide
        Swapnil Ghike added a comment -

        Can we use val jsonString = if (options.has(jsonFileOpt)) Utils.readFileAsString(jsonFile) else "" ?
        This way we don't need to provide a default to the required arg.

        Show
        Swapnil Ghike added a comment - Can we use val jsonString = if (options.has(jsonFileOpt)) Utils.readFileAsString(jsonFile) else "" ? This way we don't need to provide a default to the required arg.
        Hide
        Sriram Subramanian added a comment -

        It does not simplify anything though. Just two different ways of doing things.

        Show
        Sriram Subramanian added a comment - It does not simplify anything though. Just two different ways of doing things.
        Hide
        Swapnil Ghike added a comment -

        Well, you avoid a small jump in logic (jsonFile == "" => option not provided an argument). Also we have been using options.has() in other tools.

        Show
        Swapnil Ghike added a comment - Well, you avoid a small jump in logic (jsonFile == "" => option not provided an argument). Also we have been using options.has() in other tools.
        Hide
        Neha Narkhede added a comment -

        +1

        Show
        Neha Narkhede added a comment - +1
        Hide
        Neha Narkhede added a comment -

        Checked in.

        Show
        Neha Narkhede added a comment - Checked in.

          People

          • Assignee:
            Sriram Subramanian
            Reporter:
            Swapnil Ghike
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development