Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Remove timeout, clarify return codes

...

Code Block
class ElectPreferredReplicaLeaderOptions {
    long timeout()
    ElectPreferredReplicaLeaderOptions timeout(long timeout)
}
class ElectPreferredReplicaLeaderResult {
    Map<TopicPartition, KafkaFuture<Void>> values();
}

...

No Format
ElectPreferredReplicaLeaderRequest => [topcPartition] timeout
  topicPartition => topic partition_id
    topic => STRING
    partition_id => INT32
  timeout => INT32 

Where

FieldDescription
topica topic name
partition_ida partition of the topic
timeoutthe time to wait for the election to complete

The request will require ClusterAction operation on the Cluster resource. TODO Or should this be ALTER on the Topic?

Note that a ElectPreferredReplicaLeaderRequest can be sent to any node in the cluster; it's not necessary to target a request to a leader ir follower broker for a partition.

No Format
ElectPreferredReplicaLeaderResponse => throttle_time_ms [replica_election_result]
  throttle_time_ms => INT32
  replica_election_result => topic partition_id error_code error_message
    topic => STRING
    partition_id => INT32
    error_code => INT16
    error_message => NULLABLE_STRING

...

FieldDescription
throttle_time_msduration in milliseconds for which the request was throttled
topica topic name from the request
partition_ida partition id for the topic
error_codean error code for that partition
error_messagemore detailed information about any error for that topic

Anticipated errors:

  • INVALID

    UNKNOWN_TOPIC_

    EXCEPTION

    OR_PARTITION (

    17

    3) If the topic or partition doesn't exist

    on any broker in the cluster. Note that the use of this code is not precisely the same as it's usual meaning of "This server does not host this topic-partition".

  • REPLICA_LEADER_ELECTION_IN_PROGRESS (new) If there is an election already in progress. The request can be attempted again later

    INVALID_REQUEST (42) If duplicate topics appeared in the request

    .

  • NONE (0) The topic partition count was changed successfully.

...