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

Resolve bugs in PreferredReplicaLeaderElection admin tool

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

        Activity

        Hide
        sriramsub 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
        sriramsub 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
        swapnilghike 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
        swapnilghike 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
        sriramsub Sriram Subramanian added a comment -

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

        Show
        sriramsub Sriram Subramanian added a comment - It does not simplify anything though. Just two different ways of doing things.
        Hide
        swapnilghike 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
        swapnilghike 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
        nehanarkhede Neha Narkhede added a comment -

        +1

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

        Checked in.

        Show
        nehanarkhede Neha Narkhede added a comment - Checked in.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development