-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[KIP-482]: Update LeaveGroup API (v1 -> v4) #5248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
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 LeaveGroup protocol from v1 to v4, implementing batch member removal (v3) and flexible protocol format with tagged fields (v4). The changes enable removing multiple group members in a single request and adopt Kafka's modern protocol format for future extensibility.
Key changes:
- Modified LeaveGroup API to accept an array of members instead of a single member ID
- Added support for static group membership via group_instance_id field
- Implemented flexible protocol format with compact arrays and tagged fields for v4
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/rdkafka_request.h | Added rd_kafka_leave_member_t struct and updated LeaveGroupRequest signature to accept member arrays |
| src/rdkafka_request.c | Updated request builder to handle v3 batch members and v4 flexible format; removed old response handler |
| src/rdkafka_mock_handlers.c | Enhanced mock handler to process multiple members and return per-member errors in v3+ |
| src/rdkafka_cgrp.c | Updated response handler to parse member-level errors and modified leave logic to use new array-based API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /**@}*/ | ||
|
|
||
| /** | ||
| * @brief LeaveGroup memebr identity (for LeaveGroup version 3) |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'memebr' to 'member'.
| * @brief LeaveGroup memebr identity (for LeaveGroup version 3) | |
| * @brief LeaveGroup member identity (for LeaveGroup version 3) |
|
|
||
| static void rd_kafka_cgrp_leave(rd_kafka_cgrp_t *rkcg) { | ||
| char *member_id; | ||
| int member_cnt = 1; |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable member_cnt is declared but never modified or used meaningfully. Consider removing it or using it to make the code more maintainable if it's intended for future use.
Upgrades LeaveGroup protocol to v4, adding batch member removal (v3) and tagged fields (v4).
v3 changes
A list of members is returned (supporting static membership from KIP-345), where each member contains:
v4 changes