muralibasani commented on code in PR #24193:
URL: https://github.com/apache/kafka/pull/24193#discussion_r4646873926


##########
tools/src/main/java/org/apache/kafka/tools/streams/StreamsGroupCommand.java:
##########
@@ -462,13 +465,19 @@ Map<TopicPartition, OffsetsInfo> 
getOffsets(StreamsGroupDescription description)
             for (StreamsGroupMemberDescription memberDescription : members) {
                 
allTp.addAll(getTopicPartitions(memberDescription.assignment().activeTasks(), 
description));
             }
+            // A member that stopped without leaving the group keeps its 
assignment until its session times out, so the
+            // assignment can reference a topic or partition that has since 
been deleted. listOffsets would fail or retry
+            // until the timeout for those, so only query partitions with a 
leader and report the rest as unknown.
+            List<TopicPartition> partitionsWithoutLeader = 
groupOffsetsResetter.filterNoneLeaderPartitions(allTp);
             // fetch latest and earliest offsets
             Map<TopicPartition, OffsetSpec> earliest = new HashMap<>();
             Map<TopicPartition, OffsetSpec> latest = new HashMap<>();
 
             for (TopicPartition tp : allTp) {
-                earliest.put(tp, OffsetSpec.earliest());
-                latest.put(tp, OffsetSpec.latest());
+                if (!partitionsWithoutLeader.contains(tp)) {

Review Comment:
   Fixed, it's a HashSet now. 



-- 
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]

Reply via email to