smjn commented on code in PR #19478:
URL: https://github.com/apache/kafka/pull/19478#discussion_r2046256836


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -8200,50 +8200,119 @@ public Optional<DeleteShareGroupStateParameters> 
shareGroupBuildPartitionDeleteR
 
     /**
      * Returns a list of delete share group state request topic objects to be 
used with the persister.
-     * @param groupId - group ID of the share group
-     * @param requestData - the request data for DeleteShareGroupOffsets 
request
-     * @param errorTopicResponseList - the list of topics not found in the 
metadata image
+     * @param groupId                    group ID of the share group
+     * @param requestData                the request data for 
DeleteShareGroupOffsets request
+     * @param errorTopicResponseList     the list of topics not found in the 
metadata image
+     * @param records                    List of coordinator records to append 
to
+     *
      * @return List of objects representing the share group state delete 
request for topics.
      */
     public List<DeleteShareGroupStateRequestData.DeleteStateData> 
sharePartitionsEligibleForOffsetDeletion(
         String groupId,
         DeleteShareGroupOffsetsRequestData requestData,
-        
List<DeleteShareGroupOffsetsResponseData.DeleteShareGroupOffsetsResponseTopic> 
errorTopicResponseList
+        
List<DeleteShareGroupOffsetsResponseData.DeleteShareGroupOffsetsResponseTopic> 
errorTopicResponseList,
+        List<CoordinatorRecord> records
     ) {
         List<DeleteShareGroupStateRequestData.DeleteStateData> 
deleteShareGroupStateRequestTopicsData = new ArrayList<>();
+        Map<Uuid, Set<Integer>> initializedTopics = new HashMap<>();
+
+        ShareGroupStatePartitionMetadataInfo currentMap = 
shareGroupPartitionMetadata.get(groupId);
+
+        if (currentMap == null) {
+            return deleteShareGroupStateRequestTopicsData;
+        }
+
+        currentMap.initializedTopics().forEach((topicId, partitions) -> 
initializedTopics.put(topicId, new HashSet<>(partitions)));
+        Set<Uuid> deletingTopics = new HashSet<>(currentMap.deletingTopics());
 
-        Map<Uuid, Set<Integer>> initializedSharePartitions = 
initializedShareGroupPartitions(groupId);
         requestData.topics().forEach(topic -> {
             Uuid topicId = 
metadataImage.topics().topicNameToIdView().get(topic.topicName());

Review Comment:
   `metadataImage.topics.getTopic(topic.topicName()).id()`



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

Reply via email to