conduktor.io ↗

Kafka AssignReplicasToDirs Request Wire Format v0 — Binary Protocol Layout

What is AssignReplicasToDirs?

The KRaft controller assigns partition replicas to specific log directories on a broker, for multi-disk and tiered storage configurations. When a new log directory is added, replicas can be redistributed across directories through this API rather than needing a full cross-broker reassignment.

Wire Diagram

Request Header · flexible
message_size int32 · 4B
api_key int16 · 2B
api_version int16 · 2B
correlation_id int32 · 4B
client_id string (compact)
tagged var
AssignReplicasToDirsRequest v0
BrokerId int32 · 4B
BrokerEpoch int64 · 8B
Directories array
tagged var
Id uuid · 16B
Topics array
tagged var
TopicId uuid · 16B
Partitions array
tagged var
PartitionIndex int32 · 4B
tagged var

Schema & Example

Schema
{
  "BrokerId": int32,
  "BrokerEpoch": int64,
  "Directories": [{
      "Id": uuid,
      "Topics": [{
          "TopicId": uuid,
          "Partitions": [{
              "PartitionIndex": int32
          }]
      }]
  }]
}
Example
{
  "BrokerId": 1,
  "BrokerEpoch": 12,
  "Directories": [{
      "Id": "550e8400-e29b-41d4-a716-446655440000",
      "Topics": [{
          "TopicId": "550e8400-e29b-41d4-a716-446655440000",
          "Partitions": [{
              "PartitionIndex": 3
          }]
      }]
  }]
}