Current state: Under discussion
Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]
JIRA: here [Change the link from KAFKA-1 to your own ticket]
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
At the moment, the ListGroups API always returns all groups. There are metrics that track the number of groups in several states but the only way to know the state of a group is to describe it using the DescribeGroups API. In large clusters with hundreds or thousands of groups, it can be hard for a cluster administrator to identify which groups are stable or which groups are dead and can be deleted for example. Basically this requires describing a large number of groups which is inefficiency in terms of time for the administrator and load for the cluster. For example listing stable groups allows to immediately tell if several applications are healthy if their groups are all returned without needing to describe each group. This would allow building tools and user interfaces that can easily and quickly display informations about live groups.
ListGroups API, new version 3.
The new "state" field could be added as an optional field using KIP-482.
At the moment, consumer group state is already serialized as a STRING in DescribeGroupsResponse. To save a few bytes we could use an ID and update ConsumerGroupState?
To enable this feature in the AdminClient API, ListConsumerGroupsOptions will be updated.
- Update the ListGroups protocol definition and bump the version to 3
- A new field "state" is added to the request
- The response stays the same
- The broker will only return groups that are in the specified state. If no state is specified, the specified state is unknown, or version < 3, all groups are returned.
- Update the ListConsumerGroupsOptions object to expose this feature to the AdminClient
- This allows to user to optionally specify a state groups should be in to be returned by the broker
- Update the ConsumerGroupCommand tool also will be updated to support filtering by group state
- A new command line argument "–state STATE" enables users to specify a state. This new option will only be valid when used with "--list".
Compatibility, Deprecation, and Migration Plan
The default behaviour of ListGroups will stay the same and it will still list all groups if no state is specified.
There should be no compatibility issues, nothing to deprecate or migrate.
- Allow specifying a filter in ListGroups to retrieve groups by name or by state using wildcard
- Unclear if it's a common use case
- Allow specifying multiple states to retrieve groups in any of the provided state
- The current response only contains the names, so if multiple states are provided, we don't know which state each group is in