FrankYang0529 commented on code in PR #19761: URL: https://github.com/apache/kafka/pull/19761#discussion_r2107946290
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/ModernGroup.java: ########## @@ -398,6 +423,21 @@ public Map<String, TopicMetadata> computeSubscriptionMetadata( return Collections.unmodifiableMap(newSubscriptionMetadata); } + public static long computeMetadataHash( + Map<String, SubscriptionCount> subscribedTopicNames, + Map<String, Long> topicHashCache, + MetadataImage metadataImage + ) { + Map<String, Long> topicHash = new HashMap<>(subscribedTopicNames.size()); + subscribedTopicNames.keySet().forEach(topicName -> + topicHash.put( + topicName, + topicHashCache.computeIfAbsent(topicName, k -> Utils.computeTopicHash(topicName, metadataImage)) Review Comment: Good catch! I think we can ignore topic if related `TopicImage` is not existent, so we can revert change in `Utils#computeGroupHash`. I also add related unit tests in `ConsumerGroupTest.java`. -- 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