AndrewJSchofield commented on code in PR #20101: URL: https://github.com/apache/kafka/pull/20101#discussion_r2184721496
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java: ########## @@ -2692,7 +2690,27 @@ private boolean initializedAssignmentPending(ShareGroup group) { } } - return !initializedTps.equals(currentAssigned); + Set<String> subscribedTopicNames = group.subscribedTopicNames().keySet(); + for (Map.Entry<Uuid, InitMapValue> entry : shareGroupStatePartitionMetadata.get(group.groupId()).initializedTopics().entrySet()) { + if (subscribedTopicNames.contains(entry.getValue().name())) { + // This topic is currently subscribed, so investigate further. + Set<Integer> currentAssignedPartitions = currentAssigned.get(entry.getKey()); + if (currentAssignedPartitions != null) { + if (currentAssignedPartitions.equals(entry.getValue().partitions())) { + // The assigned and initialized partitions match, so assignment does not need to be recomputed. + continue; + } else { + // The assigned and initialized partitions do not match, so recompute the assignment. + return true; + } Review Comment: Code restructured slightly. I originally wrote it in a very simplistic style to make all of the cases really clear. But that was a bit verbose so tightened up 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org