This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.
Status
Current state: "Under Discussion"
Discussion thread: here
JIRA: here
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Motivation
When a consumer leave the consumer group, it logs the reason. However, there is not information on the broker side which makes troubleshooting rebalances triggered by LeaveGroupRequest
hard. Propagating the reason to the broker via the LeaveGroupRequest
would be really helpful in such situations.
Public Interfaces
A tagged field called Reason
is added to each member in the LeaveGroupRequest
.
{ "apiKey": 13, "type": "request", "listeners": ["zkBroker", "broker"], "name": "LeaveGroupRequest", // Version 1 and 2 are the same as version 0. // // Version 3 defines batch processing scheme with group.instance.id + member.id for identity // // Version 4 is the first flexible version. "validVersions": "0-4", "flexibleVersions": "4+", "fields": [ { "name": "GroupId", "type": "string", "versions": "0+", "entityType": "groupId", "about": "The ID of the group to leave." }, { "name": "MemberId", "type": "string", "versions": "0-2", "about": "The member ID to remove from the group." }, { "name": "Members", "type": "[]MemberIdentity", "versions": "3+", "about": "List of leaving member identities.", "fields": [ { "name": "MemberId", "type": "string", "versions": "3+", "about": "The member ID to remove from the group." }, { "name": "GroupInstanceId", "type": "string", "versions": "3+", "nullableVersions": "3+", "default": "null", "about": "The group instance ID to remove from the group." }, // New Field // { "name": "Reason", "type": "string", "versions": "4+", "nullableVersions": "4+", "taggedVersions": "4+", "tag": 0, "default": "null", "about": "The reason" } ]} ] }
Proposed Changes
The KIP adds a new tagged and per-member field called Reason
to the LeaveGroupRequest
. The field will be populated with the leaving reason by the Consumer when it wants to leave the group. The consumer already logs the reason so we will reuse the same message. The field will be populated by the AdminClient as well when removeMembersFromConsumerGroup
is called. In this case, the reason will be the consumer was removed by an admin
.
Compatibility, Deprecation, and Migration Plan
The new field defaults to null
and is optional so compatibility is not a concern.
Rejected Alternatives
The alternative would be to do nothing and to keep relying on client logs in this case.