Shekharrajak commented on code in PR #22835:
URL: https://github.com/apache/kafka/pull/22835#discussion_r3695407218


##########
server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:
##########
@@ -1553,10 +1593,14 @@ public Collection<RequestAndCompletionHandler> 
generateRequests() {
                                             oldVal.remove(coordNode);
                                             return oldVal;
                                         });
-                                        // now the combined request has 
completed
-                                        // we need to create responses for 
individual
-                                        // requests which composed the 
combined request
-                                        handlersPerGroup.forEach(handler1 -> 
handler1.onComplete(response));
+                                        // Demux the combined response once 
and share it across handlers (KAFKA-20803).
+                                        Object sharedResultIndex = 
handlersPerGroup.isEmpty()
+                                            ? null
+                                            : 
handlersPerGroup.get(0).buildResultIndex(response);
+                                        handlersPerGroup.forEach(handler1 -> {
+                                            handler1.sharedResultIndex = 
sharedResultIndex;
+                                            handler1.onComplete(response);
+                                        });

Review Comment:
   Thanks updated 
https://github.com/apache/kafka/pull/22835/changes/2c912a0e28311d53e03499d993c2102a156e9210
 



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