Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagescala
def executeAssignment(zkClient: KafkaZkClient, adminClientOpt: Option[JAdminClient], opts: ReassignPartitionsCommandOptions)

executeAssignment() will by default verify rack awareness into consideration when re-assigning the partitions.


Rack awareness should be explicitly disable using '--disable-rack-aware' option when executing Rack-aware option should be acceptable as an optional parameter while use kafka-reassign-partitions with --execute command. 

For example:

Code Block
languagebash
./kafka-reassign-partitions.sh --reassignment-json-file partitions-to-move.json --execute --zookeeper localhost:2181 --disable-rack-aware <True/False> 

$ cat partitions-to-move.json
{
  "partitions": [
    {
      "topic": "foo",
      "partition": 6,
      "replicas": [
        1004,
        1003,
        1005
      ],
      "log_dirs": [
        "any",
        "any",
        "any"
      ]
    }
  ],
  "version": 1
}

Proposed Changes

Before this proposal:

If kafka-reassign-partitions is used with custom reassignment algorithm or if the reassignment is manually generated on ad-hoc basic, the tool does not enforce rack awareness when run with --execute option.


After this proposal:

The caller can choose rack awareness on custom or manually generated reassignment planner, by choosing optional parameter --disable-rack-aware along with --execute command.By doing this if the execute command by default take rack awareness into consideration, and if the custom generated reassignment planner has conflicts along with the racks then it can will throw the error msg with appropriate reason and conflict of partitions along with the racks info, so that the users can re-generate the reassignment planner accordingly.. The users need to explicitly choose the option --disable-rack-aware if they want to ignore the rack awareness. 

Compatibility, Deprecation, and Migration Plan

...

This gonna change the current behavior of --execute command, because if the reassignment planner is generated by a custom script or ad-hoc (not by --generate option), then there are high chances of conflicts with rack awareness. So, in-order to pass through the errors, users have two options,

  1. Users can set the --disable-rack-aware option to ignore the rack awareness and pass through the errors. or
  2. Users need to generate the reassignment planner using --generate option (no custom planner).

By this change the usage of options in --execute command will be aligned with --generate option, the rack awareness well be consider by default both for --generate as well as --execute unless explicitly set to --disable-rack-aware.


There is not deprecation along with --execute is not enabled by default, so there is no compatibility concern or migration plan needed for this change.

Rejected Alternatives

None.

...