dajac commented on code in PR #23883:
URL: https://github.com/apache/kafka/pull/23883#discussion_r4346510157


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/GroupSpecBuilder.java:
##########
@@ -261,15 +242,8 @@ public GroupSpec build() {
             ))
         );
 
-        Map<Uuid, Map<Integer, String>> invertedTargetAssignment = 
this.invertedTargetAssignment;
         Optional<Map<Uuid, Set<Integer>>> topicAssignablePartitionsMap = 
this.topicAssignablePartitionsMap;
         if (assignorOffload) {
-            Map<Uuid, Map<Integer, String>> invertedTargetAssignmentCopy = 
Utils.newHashMap(invertedTargetAssignment.size());
-            for (Map.Entry<Uuid, Map<Integer, String>> entry : 
invertedTargetAssignment.entrySet()) {
-                invertedTargetAssignmentCopy.put(entry.getKey(), 
Map.copyOf(entry.getValue()));
-            }
-            invertedTargetAssignment = invertedTargetAssignmentCopy;
-
             if (topicAssignablePartitionsMap.isPresent()) {

Review Comment:
   I meant that we don't make a defensive copy of all the data structures that 
we get (e.g. the assignments).



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