zzbennett commented on code in PR #20061: URL: https://github.com/apache/kafka/pull/20061#discussion_r2191441812
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java: ########## @@ -8165,10 +8160,11 @@ public Map.Entry<AlterShareGroupOffsetsResponseData, InitializeShareGroupStatePa Map<Uuid, Map<Integer, Long>> offsetByTopicPartitions = new HashMap<>(); alterShareGroupOffsetsRequest.topics().forEach(topic -> { - TopicImage topicImage = metadataImage.topics().getTopic(topic.topicName()); - if (topicImage != null) { - Uuid topicId = topicImage.id(); - Set<Integer> existingPartitions = new HashSet<>(topicImage.partitions().keySet()); + Optional<CoordinatorMetadataImage.TopicMetadata> topicMetadataOpt = metadataImage.topicMetadata(topic.topicName()); + if (topicMetadataOpt.isPresent()) { + var topicMetadata = topicMetadataOpt.get(); + Uuid topicId = topicMetadata.id(); + Set<Integer> existingPartitions = IntStream.range(0, topicMetadata.partitionCount()).boxed().collect(Collectors.toSet()); Review Comment: yea that makes more sense -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org