Skip to content

[KIP-482]: Update OffsetForLeaderEpoch API (v2 -> v4) - #5252

Open
Ankith L (Ankith-Confluent) wants to merge 3 commits into
masterfrom
dev_OffsetForLeaderEpoch_anl
Open

[KIP-482]: Update OffsetForLeaderEpoch API (v2 -> v4)#5252
Ankith L (Ankith-Confluent) wants to merge 3 commits into
masterfrom
dev_OffsetForLeaderEpoch_anl

Conversation

@Ankith-Confluent

Copy link
Copy Markdown
Member

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):

  • -1 for consumer requests (requires TOPIC-level Describe permission)
  • broker_id for follower replica requests

v4 changes

Adopts flexible protocol format with compact arrays, compact strings, and tagged fields for future extensibility.

@confluent-cla-assistant

Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

@Ankith-Confluent
Ankith L (Ankith-Confluent) marked this pull request as ready for review November 28, 2025 04:31
Copilot AI review requested due to automatic review settings November 28, 2025 04:31
@Ankith-Confluent
Ankith L (Ankith-Confluent) requested a review from a team as a code owner November 28, 2025 04:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants