echonesis commented on code in PR #10591:
URL: https://github.com/apache/ozone/pull/10591#discussion_r3489572061


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/GrpcOmTransport.java:
##########
@@ -174,6 +206,67 @@ public void start() throws IOException {
 
   @Override
   public OMResponse submitRequest(OMRequest payload) throws IOException {
+    if (useFollowerRead && OmUtils.shouldSendToFollower(payload)) {
+      return submitRequestWithFollowerRead(payload);
+    }
+    return submitRequestToLeader(addReadConsistencyHint(payload,
+        leaderReadConsistency));
+  }
+
+  private OMResponse submitRequestWithFollowerRead(OMRequest payload)
+      throws IOException {
+    OMRequest followerPayload = addReadConsistencyHint(payload,
+        followerReadConsistency);
+    int failedCount = 0;
+    for (int i = 0; useFollowerRead &&
+        i < omFailoverProxyProvider.getOMProxyMap().getNodeIds().size(); i++) {
+      String nodeId = getCurrentFollowerReadNodeId();
+      if (isCurrentLeaderNode(nodeId)) {
+        changeFollowerReadProxy(nodeId);
+        continue;
+      }

Review Comment:
   Agreed. 
   I removed the leader-skipping logic from the gRPC follower read path to keep 
it consistent with Hadoop RPC. 
   With follower read enabled, gRPC can now send `LINEARIZABLE_ALLOW_FOLLOWER` 
reads to the currently selected OM even if it is the known leader.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to