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


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorService.java:
##########
@@ -822,21 +834,60 @@ public 
CompletableFuture<DeleteGroupsResponseData.DeletableGroupResultCollection
         });
 
         groupsByTopicPartition.forEach((topicPartition, groupList) -> {
-            
CompletableFuture<DeleteGroupsResponseData.DeletableGroupResultCollection> 
future =
-                runtime.scheduleWriteOperation(
-                    "delete-groups",
-                    topicPartition,
-                    Duration.ofMillis(config.offsetCommitTimeoutMs()),
-                    coordinator -> coordinator.deleteGroups(context, groupList)
-                ).exceptionally(exception -> handleOperationException(
-                    "delete-groups",
-                    groupList,
-                    exception,
-                    (error, __) -> 
DeleteGroupsRequest.getErrorResultCollection(groupList, error),
-                    log
-                ));
-
-            futures.add(future);
+            
CompletableFuture<DeleteGroupsResponseData.DeletableGroupResultCollection> 
shareFuture = deleteShareGroups(topicPartition, groupList)

Review Comment:
   It was discouraged - we can do it ...
   
   So, first we will send a list of all groups to GroupCoordinatorShard which 
will return a list of delete requests only for VALID SHARE GROUPS. Other groups 
will be ignored. This is the only extra work - we are only reading state from 
the a hashmap.
   
   We can alleviate the situation by checking `shareGroup.isEmpty()` in 
`GroupMetadataManager`. That way, the `persister.deleteState` will not be 
called for that group but the standard deleteGroups code will be called.



##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorService.java:
##########
@@ -822,21 +834,60 @@ public 
CompletableFuture<DeleteGroupsResponseData.DeletableGroupResultCollection
         });
 
         groupsByTopicPartition.forEach((topicPartition, groupList) -> {
-            
CompletableFuture<DeleteGroupsResponseData.DeletableGroupResultCollection> 
future =
-                runtime.scheduleWriteOperation(
-                    "delete-groups",
-                    topicPartition,
-                    Duration.ofMillis(config.offsetCommitTimeoutMs()),
-                    coordinator -> coordinator.deleteGroups(context, groupList)
-                ).exceptionally(exception -> handleOperationException(
-                    "delete-groups",
-                    groupList,
-                    exception,
-                    (error, __) -> 
DeleteGroupsRequest.getErrorResultCollection(groupList, error),
-                    log
-                ));
-
-            futures.add(future);
+            
CompletableFuture<DeleteGroupsResponseData.DeletableGroupResultCollection> 
shareFuture = deleteShareGroups(topicPartition, groupList)

Review Comment:
   using persister in shard was discouraged - we can do it ...
   
   So, first we will send a list of all groups to GroupCoordinatorShard which 
will return a list of delete requests only for VALID SHARE GROUPS. Other groups 
will be ignored. This is the only extra work - we are only reading state from 
the a hashmap.
   
   We can alleviate the situation by checking `shareGroup.isEmpty()` in 
`GroupMetadataManager`. That way, the `persister.deleteState` will not be 
called for that group but the standard deleteGroups code will be called.



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