What is AlterPartition?
Brokers notify the KRaft controller of ISR changes through this API when a follower catches up (expansion) or falls behind (shrink). This replaced the ZooKeeper watcher-based ISR change path; in KRaft mode, all ISR changes flow here, making them serializable and auditable.
Wire Diagram
Response Header · flexible
message_size
int32 · 4B
correlation_id
int32 · 4B
tagged
var
AlterPartitionResponse v3
ThrottleTimeMs
int32 · 4B
ErrorCode
int16 · 2B
tagged
var
TopicId
uuid · 16B
tagged
var
PartitionIndex
int32 · 4B
ErrorCode
int16 · 2B
LeaderId
int32 · 4B
LeaderEpoch
int32 · 4B
Isr
[]int32
LeaderRecoveryState
int8 · 1B
PartitionEpoch
int32 · 4B
tagged
var
Schema & Example
Schema { "ThrottleTimeMs": int32, "ErrorCode": int16, "Topics": [{ "TopicId": uuid, "Partitions": [{ "PartitionIndex": int32, "ErrorCode": int16, "LeaderId": int32, "LeaderEpoch": int32, "Isr": [int32], "LeaderRecoveryState": int8, "PartitionEpoch": int32 }] }] }
Example { "ThrottleTimeMs": 0, "ErrorCode": 0, "Topics": [{ "TopicId": "550e8400-e29b-41d4-a716-446655440000", "Partitions": [{ "PartitionIndex": 3, "ErrorCode": 0, "LeaderId": 1, "LeaderEpoch": 17, "Isr": [0, 1, 2], "LeaderRecoveryState": 1, "PartitionEpoch": 12 }] }] }