conduktor.io ↗

Kafka OffsetForLeaderEpoch Changelog — Protocol Version History

What is OffsetForLeaderEpoch?

Follower replicas call this after a leader failover to determine the divergence point and truncate their local log to match the new leader. Without it, a follower might replay entries the new leader doesn't have, causing data inconsistency across leader elections.

VersionKafkaChanges
OffsetForLeaderEpochRequest
v22.2
+ CurrentLeaderEpoch int32
adds the current leader epoch to support fencing.
v32.3
+ ReplicaId int32
adds ReplicaId (the default is -2 which conventionally represents a "debug" consumer which is allowed to see offsets beyond the high watermark). Followers will use this replicaId when using an older version of the protocol.
v42.8
~ Flexible encoding enabled FLEXIBLE
enables flexible versions.
OffsetForLeaderEpochResponse
v22.2
+ ThrottleTimeMs int32
added the throttle time.
v32.3
is the same as version 2.
v42.8
~ Flexible encoding enabled FLEXIBLE
enables flexible versions.