Skip to content

Conversation

@Ankith-Confluent
Copy link
Member

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:

  • member_id: The member ID to remove
  • group_instance_id: The static group instance ID (nullable)

v4 changes

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

@confluent-cla-assistant
Copy link

🎉 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-Confluent changed the title [KIP-482]: Update Describe Configs (v1 -> v4) [KIP-482]: Update LeaveGroup API (v1 -> v4) Nov 24, 2025
@Ankith-Confluent Ankith-Confluent marked this pull request as ready for review November 24, 2025 17:27
@Ankith-Confluent Ankith-Confluent requested a review from a team as a code owner November 24, 2025 17:27
Copilot AI review requested due to automatic review settings November 24, 2025 17:27
Copy link

Copilot AI left a 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)
Copy link

Copilot AI Nov 24, 2025

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'.

Suggested change
* @brief LeaveGroup memebr identity (for LeaveGroup version 3)
* @brief LeaveGroup member identity (for LeaveGroup version 3)

Copilot uses AI. Check for mistakes.

static void rd_kafka_cgrp_leave(rd_kafka_cgrp_t *rkcg) {
char *member_id;
int member_cnt = 1;
Copy link

Copilot AI Nov 24, 2025

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.

Copilot uses AI. Check for mistakes.
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