conduktor.io ↗

Kafka ElectLeaders Response 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

Response Header
message_size int32 · 4B
correlation_id int32 · 4B
ElectLeadersResponse v0
ThrottleTimeMs int32 · 4B
ReplicaElectionResults array
Topic string
PartitionResult array
PartitionId int32 · 4B
ErrorCode int16 · 2B
ErrorMessage? string

Schema & Example

Schema
{
  "ThrottleTimeMs": int32,
  "ReplicaElectionResults": [{
      "Topic": string,
      "PartitionResult": [{
          "PartitionId": int32,
          "ErrorCode": int16,
          "ErrorMessage": string?
      }]
  }]
}
Example
{
  "ThrottleTimeMs": 0,
  "ReplicaElectionResults": [{
      "Topic": "orders",
      "PartitionResult": [{
          "PartitionId": 1,
          "ErrorCode": 0,
          "ErrorMessage": null
      }]
  }]
}