aliehsaeedii commented on code in PR #24321:
URL: https://github.com/apache/kafka/pull/24321#discussion_r4644590152
##########
tools/src/test/java/org/apache/kafka/tools/streams/StreamsGroupCommandTest.java:
##########
@@ -342,6 +343,71 @@ public void testDescribeStreamsGroupsGetOffsets() throws
Exception {
service.close();
}
+ @Test
+ public void testDescribeEmptyStreamsGroupShowsCommittedOffsets() throws
Exception {
Review Comment:
Added `testDescribeStableStreamsGroupIncludesCommittedUnassignedPartitions`
in 660300d: a Stable group whose only member owns `topic1-0`, plus a committed
offset for `topic1-1`. It checks that `listOffsets` is asked for both
partitions and that both rows are returned, and it fails if the committed
partitions are not added.
##########
tools/src/main/java/org/apache/kafka/tools/streams/StreamsGroupCommand.java:
##########
@@ -462,6 +462,14 @@ Map<TopicPartition, OffsetsInfo>
getOffsets(StreamsGroupDescription description)
for (StreamsGroupMemberDescription memberDescription : members) {
allTp.addAll(getTopicPartitions(memberDescription.assignment().activeTasks(),
description));
}
+ // Also include partitions that have committed offsets but are not
assigned to any member,
+ // e.g., when the group is empty, so that their committed offsets
are still shown.
+ Map<TopicPartition, OffsetAndMetadata> committedOffsets =
getCommittedOffsets(description.groupId());
Review Comment:
Done in 660300d: `getOffsets` now passes the description to a new
`getCommittedOffsets(StreamsGroupDescription)` overload, so the group is no
longer described twice. The `groupId` variant stays for the reset and delete
paths and delegates to it.
--
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]