...
1// StopReplicaRequest is an advanced request that brokers use to stop replicas.
2//
3// As this is an advanced request and there is little reason to issue it as a
4// client, this request is undocumented.
5//
6// Kafka 2.2 introduced version 1, proposed in KIP-380, which changed the
7// layout of the struct to be more memory efficient.
8//
9// Kafka 2.6 introduced version 3, proposed in KIP-570, reorganizes partitions
10// to be stored and adds the leader epoch and delete partition fields per partition.
11// Kafka 3.4 introduced version 4 with KIP-866.
12StopReplicaRequest => key 5, max version 4, flexible v2+
13 ControllerID: int32
14 ControllerEpoch: int32
15 // If KRaft controller id is used during migration. See KIP-866.
16 IsKRaftController: bool // v4+
17 BrokerEpoch: int64(-1) // v1+
18 DeletePartitions: bool // v0-v2
19 Topics: [=>]
20 Topic: string
21 Partition: int32 // v0-v0
22 Partitions: [int32] // v1-v2
23 PartitionStates: [=>] // v3+
24 Partition: int32
25 LeaderEpoch: int32(-1)
26 Delete: bool
27
28// StopReplicasResponse is returned from a StopReplicasRequest.
29StopReplicaResponse =>
30 // Version 3 returns FENCED_LEADER_EPOCH if the leader is stale (KIP-570).
31 ErrorCode: int16
32 Partitions: [=>]
33 Topic: string
34 Partition: int32
35 ErrorCode: int16
View as plain text