KAFKA-20695: Extend "describe group" to return "task offset" metadata#22808
Open
gabriellefu wants to merge 2 commits into
Open
KAFKA-20695: Extend "describe group" to return "task offset" metadata#22808gabriellefu wants to merge 2 commits into
gabriellefu wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Under KIP-1071, Streams group members report their per-task cumulative changelog offsets (
taskOffsets) and end offsets (taskEndOffsets) to the group coordinator via theStreamsGroupHeartbeatRPC, and the coordinator keeps the latest reported values in memory.This PR exposes those stored offsets through the
StreamsGroupDescribeRPC /Admin.describeStreamsGroups(...).The response schema and the Admin client already defined
TaskOffsets/TaskEndOffsets; the broker's describe path simply never populated them, so a described member always returned empty lists. This PR wires the in-memory offsets into the response:StreamsGroupMember#asStreamsGroupDescribeMember(...)now takes the member'sMemberTaskOffsetsand populatesTaskOffsets/TaskEndOffsets, sorted byTaskIdfor a deterministic response.StreamsGroup#asDescribedGroup(...)reads the offsets viataskOffsets(memberId)and passes them to the member builder.These offsets are transient and not persisted (per KIP-1071), so they are read from the latest in-memory state rather than at the committed offset. A member that has not reported offsets, or an empty group, describes as empty lists.
Testing
StreamsGroupMemberTest: populated + sorted offsets, plus an empty/null case.StreamsGroupTest: offsets seeded viaupdateTaskOffsets(...)surface throughasDescribedGroup(...).GroupMetadataManagerTest: end-to-end; offsets reported via heartbeat are returned bystreamsGroupDescribe(...).