jsancio commented on code in PR #19668:
URL: https://github.com/apache/kafka/pull/19668#discussion_r2114296083


##########
raft/src/main/java/org/apache/kafka/raft/RequestManager.java:
##########
@@ -17,23 +17,26 @@
 package org.apache.kafka.raft;
 
 import org.apache.kafka.common.Node;
+import org.apache.kafka.common.protocol.ApiKeys;
+import org.apache.kafka.raft.internals.RequestType;
 
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Optional;
 import java.util.OptionalLong;
 import java.util.Random;
 
 /**
- * The request manager keeps tracks of the connection with remote replicas.
+ * The request manager keeps track of the pending requests with remote 
replicas. The manager supports
+ * one pending request per type per node, except for FETCH and FETCH_SNAPSHOT 
requests. For those,
+ * the manager allows at most one pending request across all nodes to prevent 
writing the same offset twice.
  *
- * When sending a request update this type by calling {@code 
onRequestSent(Node, long, long)}. When
- * the RPC returns a response, update this manager with {@code 
onResponseResult(Node, long, boolean, long)}.
+ * When sending a request update this type by calling {@code 
onRequestSent(Node, long, long, ApiKeys)}.
+ * When the RPC returns a response, update this manager with {@code 
onResponseResult(Node, long, boolean, long, ApiKeys)}.
  *
- * Connections start in the ready state ({@code isReady(Node, long)} returns 
true).
+ * Requests start in the ready state ({@code isReady(Node, long, ApiKeys)} 
returns true).
  *
  * When a request times out or completes successfully the collection will 
transition back to the
  * ready state.

Review Comment:
   I think this paragraph meant to say
   ```java
    * When a request times out or completes successfully the connection will 
transition back to the
    * ready state.
   ```
   
   We can change this to
   ```java
    * When a request times out or completes successfully the request state will 
transition back to the
    * ready state.
   ```



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