What is ListOffsets?
Resolves earliest, latest, or timestamp-based offsets, and powers the lag computation in kafka-consumer-groups.sh. Timestamp-based lookups map to the largest offset whose timestamp is <= the given value, which is how you rewind to a point in time after an incident.
| Version | Kafka | Changes |
|---|---|---|
| ListOffsetsRequest | ||
| v1 | 2.8 | removes MaxNumOffsets. From this version forward, only a single offset can be returned. |
| v2 | 2.8 | + IsolationLevel int8adds the isolation level, which is used for transactional reads. |
| v3 | 2.8 | is the same as version 2. |
| v4 | 2.8 | + CurrentLeaderEpoch int32adds the current leader epoch, which is used for fencing. |
| v5 | 2.8 | is the same as version 4. |
| v6 | 2.8 | ~ Flexible encoding enabled FLEXIBLE enables flexible versions. |
| v7 | 3.0 | enables listing offsets by max timestamp (KIP-734). |
| v8 | 3.5 | enables listing offsets by local log start offset (KIP-405). |
| v9 | 3.9 | enables listing offsets by last tiered offset (KIP-1005). |
| v10 | 4.0 | + TimeoutMs int32enables async remote list offsets support (KIP-1075) |
| v11 | 4.2 | enables listing offsets by earliest pending upload offset (KIP-1023) |
| ListOffsetsResponse | ||
| v1 | 2.8 | + Timestamp int64+ Offset int64also adds the timestamp associated with the returned offset. |
| v2 | 2.8 | + ThrottleTimeMs int32adds the throttle time. |
| v3 | 2.8 | on quota violation, brokers send out responses before throttling. |
| v4 | 2.8 | + LeaderEpoch int32adds the leader epoch, which is used for fencing. |
| v5 | 2.8 | adds a new error code, OFFSET_NOT_AVAILABLE. |
| v6 | 2.8 | ~ Flexible encoding enabled FLEXIBLE enables flexible versions. |
| v7 | 3.0 | is the same as version 6 (KIP-734). |
| v8 | 3.5 | enables listing offsets by local log start offset. This is the earliest log start offset in the local log. (KIP-405). |
| v9 | 3.9 | enables listing offsets by last tiered offset (KIP-1005). |
| v10 | 4.0 | enables async remote list offsets support (KIP-1075) |
| v11 | 4.2 | enables listing offsets by earliest pending upload offset (KIP-1023) |