CalvinConfluent commented on code in PR #13323:
URL: https://github.com/apache/kafka/pull/13323#discussion_r1123469847


##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -936,13 +937,13 @@ private CompletableFuture<FetchResponseData> 
handleFetchRequest(
         RaftRequest.Inbound requestMetadata,
         long currentTimeMs
     ) {
-        FetchRequestData request = (FetchRequestData) requestMetadata.data;
+        FetchRequest request = new FetchRequest((FetchRequestData) 
requestMetadata.data, requestMetadata.apiVersion);

Review Comment:
   The FetchRequestData can have versions 14 and 15. The main problem is that 
KafakRaftClient needs the ReplicaId which is not at the field of 
FetchRequestData. We need the API version to properly locate the ReplicaId.



##########
raft/src/main/java/org/apache/kafka/raft/RaftRequest.java:
##########
@@ -45,11 +45,14 @@ public long createdTimeMs() {
         return createdTimeMs;
     }
 
+
     public static class Inbound extends RaftRequest {
         public final CompletableFuture<RaftResponse.Outbound> completion = new 
CompletableFuture<>();
+        public final short apiVersion;
 
-        public Inbound(int correlationId, ApiMessage data, long createdTimeMs) 
{
+        public Inbound(int correlationId, ApiMessage data, long createdTimeMs, 
short apiVertion) {

Review Comment:
   Used to store the API version of the FetchRequest.



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