NicoleYWDu opened a new pull request, #24071: URL: https://github.com/apache/kafka/pull/24071
Implements KIP-1388: https://cwiki.apache.org/confluence/spaces/KAFKA/pages/462815620/KIP-1388+Add+a+committed-offsets+filter+to+ListGroups Adds a `RequireCommittedOffsets` boolean to the ListGroups request (version 6). When set, the group coordinator returns only groups that have at least one committed offset. The filter is combined with the existing states and types filters. Pending transactional offsets do not count until the transaction commits. Share groups never match. Protocol: - `ListGroupsRequest` v6 adds `RequireCommittedOffsets` (bool, default false, not ignorable). `ListGroupsResponse` v6 is identical to v5. - `ListGroupsRequest.Builder.build` throws `UnsupportedVersionException` when the flag is set and the negotiated version is below 6, matching the behavior of the KIP-518 states filter. Broker: - `OffsetMetadataManager.hasCommittedOffsets(groupId, committedOffset)` checks for a group entry in the committed offsets map at the given snapshot. - `GroupCoordinatorShard.listGroups` applies the filter after `GroupMetadataManager.listGroups`, reading both at the same committed offset. `GroupMetadataManager` is unchanged. Admin client: - `ListGroupsOptions.requireCommittedOffsets(boolean)` and `ListGroupsOptions.requireCommittedOffsets()`. Default false. - `KafkaAdminClient.listGroups` sets the request field. The deprecated `listConsumerGroups` path is unchanged, as the KIP specifies. - Against a broker that does not support v6, `ListGroupsResult.all()` fails with `UnsupportedVersionException`, `errors()` has one entry per such broker, and `valid()` holds only the groups from brokers that do. Docs: - Upgrade note under "Notable changes in 4.5.0". No CLI changes. No new error codes. Existing requests at v5 or below, and v6 requests with the flag unset, return the same groups as before. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
