AndrewJSchofield commented on code in PR #23821:
URL: https://github.com/apache/kafka/pull/23821#discussion_r4359829497


##########
core/src/main/java/kafka/server/share/ShareCoordinatorMetadataCacheHelperImpl.java:
##########
@@ -176,6 +176,11 @@ public List<Node> getClusterNodes() {
         return List.of();
     }
 
+    @Override
+    public boolean isRequestHeaderV3Supported() {
+        return metadataCache.metadataVersion().isRequestHeaderV3Supported();

Review Comment:
   Let's have a null check on `metadataCache.metadataVersion()` and return 
false if it's null.



##########
clients/src/main/resources/common/message/WriteShareGroupStateResponse.json:
##########
@@ -20,7 +20,7 @@
   // Version 0 is the initial version (KIP-932).
   //
   // Version 1 introduces DeliveryCompleteCount in the request (KIP-1226).

Review Comment:
   For completeness, let's add the comment for the new versions similar to the 
requests. I understand that request header is not in the response :) Let's 
leave it all tidy.



##########
server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:
##########
@@ -1627,7 +1627,7 @@ public Collection<RequestAndCompletionHandler> 
generateRequests() {
                             // to not be sent immediately but get batched
                             if (!inFlight.containsKey(rpcType) || 
!inFlight.get(rpcType).contains(coordNode)) {
                                 AbstractRequest.Builder<? extends 
AbstractRequest> combinedRequestPerTypePerGroup =
-                                    
RequestCoalescerHelper.coalesceRequests(groupId, rpcType, handlersPerGroup);
+                                    
RequestCoalescerHelper.coalesceRequests(groupId, rpcType, handlersPerGroup, 
cacheHelper.isRequestHeaderV3Supported());

Review Comment:
   Let's put the calculation of `cacheHelper.isRequestHeaderV3Supported()` 
outside the loop and the synchronised block.



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