Chu Cheng Li created HDDS-17448:
-----------------------------------

             Summary: gRPC OM client should retry a not-ready leader like the 
Hadoop RPC client
                 Key: HDDS-17448
                 URL: https://issues.apache.org/jira/browse/HDDS-17448
             Project: Apache Ozone
          Issue Type: Sub-task
            Reporter: Chu Cheng Li


h3. Problem
* The OM retry policy retries a not-ready leader on the same OM, after a wait. 
It does this only for a {{ServiceException}}. 
{{GrpcOmTransport#unwrapException}} returns the OM exception itself. Thus, on 
{{OMLeaderNotReadyException}}, the gRPC client fails over to the next OM with 
no wait.
* {{GrpcOmTransport}} retries only the leader path. The follower read loop in 
{{GrpcOMFollowerReadFailoverProxyProvider}} has no retry around it. Thus, on 
{{OMLeaderNotReadyException}}, the loop falls back to the leader path and sends 
a new request at once.
* The Hadoop RPC client does not have these problems. Its {{RetryProxy}} wraps 
the follower read and the leader path, and it gives the retry policy a 
{{ServiceException}}.

h3. Changes
* {{GrpcOmTransport}}: move the retry loop from {{submitRequestToLeader}} to 
{{submitRequest}}, around the follower read and the leader path. Give the retry 
policy a {{ServiceException}} with the {{RemoteException}} cause.
* {{GrpcOMFollowerReadFailoverProxyProvider}}: throw 
{{OMLeaderNotReadyException}} to the retry loop, as 
{{HadoopRpcOMFollowerReadFailoverProxyProvider}} does.

h3. Tests
* The gRPC client retries a not-ready leader on the same OM, after a wait.
* A follower read that gets {{OMLeaderNotReadyException}} goes through the same 
retry.

Found in the review of HDDS-16737: 
https://github.com/apache/ozone/pull/11418#discussion_r4369504955



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to