conduktor.io ↗

Kafka Fetch Changelog — Protocol Version History

What is Fetch?

Consumers and follower replicas both issue this continuously for log replication and consumption. When a consumer's fetch stalls with empty responses despite records existing, check isolation.level: read_committed consumers are blocked by open transactions until EndTxn.

VersionKafkaChanges
FetchRequest
v42.2
+ IsolationLevel int8
adds IsolationLevel. Starting in version 4, the requestor must be able to handle Kafka log message format version 2.
v52.2
+ LogStartOffset int64
adds LogStartOffset to indicate the earliest available offset of partition data that can be consumed.
v62.2
is the same as version 5.
v72.2
+ SessionId int32
+ SessionEpoch int32
+ ForgottenTopicsData []ForgottenTopic
+ Topic string
+ Partitions []int32
adds incremental fetch request support.
v82.2
is the same as version 7.
v92.2
+ CurrentLeaderEpoch int32
adds CurrentLeaderEpoch, as described in KIP-320.
v102.2
indicates that we can use the ZStd compression algorithm, as described in KIP-110.
v112.3
+ RackId string
v122.7
+ ClusterId string
+ LastFetchedEpoch int32
~ Flexible encoding enabled FLEXIBLE
adds flexible versions support as well as epoch validation through the `LastFetchedEpoch` field
v133.1
+ TopicId uuid
+ TopicId uuid
- Topic string
- Topic string
replaces topic names with topic IDs (KIP-516). May return UNKNOWN_TOPIC_ID error code.
v143.5
is the same as version 13 but it also receives a new error called OffsetMovedToTieredStorageException(KIP-405)
v153.5
+ ReplicaState ReplicaState
+ ReplicaId int32
+ ReplicaEpoch int64
- ReplicaId int32
adds the ReplicaState which includes new field ReplicaEpoch and the ReplicaId. Also, deprecate the old ReplicaId field and set its default value to -1. (KIP-903)
v163.7
is the same as version 15 (KIP-951).
v173.9
+ ReplicaDirectoryId uuid
adds directory id support from KIP-853
v184.1
+ HighWatermark int64
adds high-watermark from KIP-1166
FetchResponse
v42.2
+ LastStableOffset int64
+ AbortedTransactions []AbortedTransaction
+ ProducerId int64
+ FirstOffset int64
adds features for transactional consumption.
v52.2
+ LogStartOffset int64
adds LogStartOffset to indicate the earliest available offset of partition data that can be consumed.
v62.2
we may return KAFKA_STORAGE_ERROR as an error code.
v72.2
+ ErrorCode int16
+ SessionId int32
adds incremental fetch request support.
v82.2
on quota violation, brokers send out responses before throttling.
v92.2
is the same as version 8.
v102.2
indicates that the response data can use the ZStd compression algorithm, as described in KIP-110.
v112.3
+ PreferredReadReplica int32
v122.7
+ DivergingEpoch EpochEndOffset
+ Epoch int32
+ EndOffset int64
+ CurrentLeader LeaderIdAndEpoch
+ LeaderId int32
+ LeaderEpoch int32
+ SnapshotId SnapshotId
~ Flexible encoding enabled FLEXIBLE
adds support for flexible versions, epoch detection through the `TruncationOffset` field, and leader discovery through the `CurrentLeader` field
v133.1
+ TopicId uuid
- Topic string
replaces the topic name field with topic ID (KIP-516).
v143.5
is the same as version 13 but it also receives a new error called OffsetMovedToTieredStorageException (KIP-405)
v153.5
is the same as version 14 (KIP-903).
v163.7
+ NodeEndpoints []NodeEndpoint
+ NodeId int32
+ Host string
+ Port int32
+ Rack string
adds the 'NodeEndpoints' field (KIP-951).
v173.9
no changes to the response (KIP-853).
v184.1
no changes to the response (KIP-1166)