ivandika3 commented on code in PR #10591:
URL: https://github.com/apache/ozone/pull/10591#discussion_r3481652375
##########
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:
Currently, we don't have this logic in the Hadoop RPC follower read since we
would like to allow read on leader (since for linearizable read the follower
read latency is way higher than leader read latency). For parity purpose, let's
remove this and add them together if we want to introduce a follower only
strategy.
--
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]