peterxcli opened a new pull request, #11418:
URL: https://github.com/apache/ozone/pull/11418

   ## What changes were proposed in this pull request?
   
   The Hadoop RPC client and the gRPC client (used by the S3 Gateway) each have 
their own copy of the OM follower read logic. The Hadoop RPC one lives in 
`HadoopRpcOMFollowerReadFailoverProxyProvider`, while the gRPC one was added 
straight into `GrpcOmTransport` by HDDS-15492. So every follower read change, 
like the per-request read consistency in HDDS-15089, has to be made twice.
   
   As suggested in 
https://github.com/apache/ozone/pull/11252#discussion_r4152973824, this PR 
moves the shared parts into a base class:
   - `FollowerReadFailoverProxyProviderBase` keeps the follower read settings, 
decides whether a request may go to a follower, adds the default read 
consistency hint, and picks the OM node for follower reads (skipping the leader 
for `LOCAL_LEASE`).
   - `HadoopRpcOMFollowerReadFailoverProxyProvider` now extends it.
   - The gRPC follower read logic moves out of `GrpcOmTransport` into a new 
`GrpcOMFollowerReadFailoverProxyProvider`, which also extends it. 
`GrpcOmTransport` is left with just sending the requests.
   
   The behavior stays the same, with one small difference. The Hadoop RPC 
provider now calls `createOMProxyIfNeeded` every time it picks a follower node, 
not only when it moves to the next node. So if a DNS refresh has dropped the 
cached proxy of the current node, the proxy is created again, instead of the 
request hitting an NPE on that node and moving on to the next one.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16737
   
   ## How was this patch tested?
   
   - New unit tests for the two new classes: 
`TestFollowerReadFailoverProxyProviderBase` and 
`TestGrpcOMFollowerReadFailoverProxyProvider`.
   - The existing follower read tests pass without changes: 
`TestHadoopRpcOMFollowerReadFailoverProxyProvider`, `TestS3GrpcOmTransport`, 
`TestOzoneManagerHAFollowerReadWithAllRunning` and 
`TestOzoneManagerHAFollowerReadWithStoppedNodes`.
   


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