...
Code Block | ||
---|---|---|
| ||
OffsetForLeaderEpochRequestOffsetsForLeaderEpochRequest => [Topic] Topic => TopicName [Partition] TopicName => STRING Partition => PartitionId CurrentLeaderEpoch LeaderEpoch PartitionId => INT32 CurrentLeaderEpoch => INT32 // New LeaderEpoch => INT32 |
If the current leader epoch does not match that of the leader, then we will send either FENCED_REPLICA or UNKNOWN_LEADER_EPOCH as we do for the Fetch API.
Metadata
The metadata response will be extended to include the leader epoch. This enables stronger fencing for consumers. We can enable similar protection in producers in the future, but that is out of the scope of this KIP.
Since this API is no longer exclusively an inter-broker API, we will also add the throttle time to the response schema.
Code Block |
---|
OffsetsForLeaderEpochResponse => ThrottleTimeMs [TopicMetadata]
ThrottleTimeMs => INT32 // New
TopicMetadata => TopicName PartitionMetadata
TopicName => STRING
PartitionMetadata => [ErrorCode PartitionId LeaderEpoch EndOffset]
ErrorCode => INT16
PartitionId => INT32
LeaderEpoch => INT32
EndOffset => INT64 |
Metadata
The metadata response will be extended to include the leader epoch. This enables stronger fencing for consumers. We can enable similar protection in producers in the future, but that is out of the scope of this KIP.
Code Block | ||
---|---|---|
| ||
MetadataResponse => ThrottleTimeMs Brokers ClusterId ControllerId [TopicMetadata]
ThrottleTimeMs => INT32 | ||
Code Block | ||
| ||
MetadataResponse => Brokers ClusterId ControllerId [TopicMetadata]
Brokers => [MetadataBroker]
ClusterId => NULLABLE_STRING
ControllerId => INT32
TopicMetadata => ErrorCode TopicName IsInternal [PartitionMetadata]
ErrorCode => INT16
TopicName => STRING
IsInternal => BOOLEAN
PartitionMetadata => ErrorCode PartitionId Leader LeaderEpoch Replicas ISR OfflineReplicas
ErrorCode => INT16
PartitionId => INT32
Leader => INT32
LeaderEpoch => INT32 // New
Replicas => [INT32]
ISR => [INT32]
OfflineReplicas => [INT32] |
...