conduktor.io ↗

Kafka ElectLeaders Request Wire Format v0 — Binary Protocol Layout

What is ElectLeaders?

Forces preferred leader elections or triggers unclean elections via kafka-leader-election.sh. Preferred election safely moves leadership back to the first replica; unclean election (type=1) risks data loss by electing an out-of-sync replica when no in-sync replica is available.

Related Errors

ELECTION_NOT_NEEDED · ELIGIBLE_LEADERS_NOT_AVAILABLE · NOT_CONTROLLER

Wire Diagram

Request Header
message_size int32 · 4B
api_key int16 · 2B
api_version int16 · 2B
correlation_id int32 · 4B
client_id string
ElectLeadersRequest v0
TopicPartitions? array
TimeoutMs int32 · 4B
Topic string
Partitions []int32

Schema & Example

Schema
{
  "TopicPartitions": [{
      "Topic": string,
      "Partitions": [int32]
  }]?,
  "TimeoutMs": int32
}
Example
{
  "TopicPartitions": [{
      "Topic": "orders",
      "Partitions": [1, 2, 3]
  }]?,
  "TimeoutMs": 30000
}