[KIP-482]: Update OffsetForLeaderEpoch API (v2 -> v4) - #5252
Open
Ankith L (Ankith-Confluent) wants to merge 3 commits into
Open
[KIP-482]: Update OffsetForLeaderEpoch API (v2 -> v4)#5252Ankith L (Ankith-Confluent) wants to merge 3 commits into
Ankith L (Ankith-Confluent) wants to merge 3 commits into
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
Pull request overview
This PR upgrades the OffsetForLeaderEpoch protocol from version 2 to version 4, implementing KIP-482 changes. Version 3 adds the ReplicaId field to improve the permission model (KIP-320), while version 4 adopts the flexible protocol format with compact arrays and tagged fields.
Key changes:
- Added ReplicaId parameter (-1 for consumer requests) to the OffsetForLeaderEpoch request API
- Implemented flexible protocol format support (v4) with tagged field handling in request and response paths
- Updated mock handler to support versions 2-4 with proper tag skipping and writing
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/rdkafka_request.h | Added replica_id parameter to OffsetForLeaderEpochRequest function signature |
| src/rdkafka_request.c | Implemented v3 (ReplicaId field) and v4 (flexible format with tags) protocol support in request/response handlers |
| src/rdkafka_offset.c | Updated offset validation to pass ReplicaId=-1 for consumer requests |
| src/rdkafka_mock_handlers.c | Enhanced mock handler to support v3-v4 protocol with ReplicaId reading and tag handling at all nesting levels |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ankith L (Ankith-Confluent)
requested a review
from Emanuele Sabellico (emasab)
November 28, 2025 04:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrades OffsetForLeaderEpoch protocol to v4, adding ReplicaId field (v3) and flexible protocol format (v4).
v3 changes
Added ReplicaId field to improve permission model (KIP-320):
v4 changes
Adopts flexible protocol format with compact arrays, compact strings, and tagged fields for future extensibility.