Versions Compared

Key

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

...

REPLICA_ASSIGNOR_FAILED: The replica assignor could not compute an assignment for the topic or partition.

Proposed Changes

The existing assignment logic will be extracted into a class, DefaultReplicaAssignmentDefaultReplicaAssignor, that implements the ReplicaAssignor interface. It will stay as the default implementation and a private class. Instead of throwing AdminOperationException, it will be updated to throw ReplicaAssignorException so users get a better error.

...

Compatibility, Deprecation, and Migration Plan

The current behaviour stays the same. This is just an additional feature administrators can opt-innew exception/error code changes some of responses clients can get if DefaultReplicaAssignor encounters an error. For example, if a cluster contains brokers with and without "broker.rack", the error will be REPLICA_ASSIGNOR_FAILED instead of UNKNOWN_SERVER_ERROR.

Rejected Alternatives

  • Computing assignments for the whole batch: Instead of computing assignment for each topic in the CreateTopics/CreatePartitions request one at a time, we looked at computing assignment for all of them in a single call. We rejected this approach for the following reasons:
    • All logic (validation, policies, creation in ZK) in AdminManager works on a single topic at a time. Grouping the replica assignment computation created very complicated logic
    • It's not clear if having all topics at once would significantly improve computed assignments. This is especially true for the 4 scenarios listed in the Motivation section

...