Skip to content

KAFKA-20695: Extend "describe group" to return "task offset" metadata#22808

Open
gabriellefu wants to merge 2 commits into
apache:trunkfrom
gabriellefu:offset
Open

KAFKA-20695: Extend "describe group" to return "task offset" metadata#22808
gabriellefu wants to merge 2 commits into
apache:trunkfrom
gabriellefu:offset

Conversation

@gabriellefu

@gabriellefu gabriellefu commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Under KIP-1071, Streams group members report their per-task cumulative changelog offsets (taskOffsets) and end offsets (taskEndOffsets) to the group coordinator via the StreamsGroupHeartbeat RPC, and the coordinator keeps the latest reported values in memory.

This PR exposes those stored offsets through the StreamsGroupDescribe RPC / 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's MemberTaskOffsets and populates TaskOffsets / TaskEndOffsets, sorted by TaskId for a deterministic response.
  • StreamsGroup#asDescribedGroup(...) reads the offsets via taskOffsets(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 via updateTaskOffsets(...) surface through asDescribedGroup(...).
  • GroupMetadataManagerTest: end-to-end; offsets reported via heartbeat are returned by streamsGroupDescribe(...).

@github-actions github-actions Bot added triage PRs from the community group-coordinator labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

group-coordinator triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant