HDDS-15492. Support OM follower read for gRPC client#10591
Conversation
ivandika3
left a comment
There was a problem hiding this comment.
Thanks @echonesis , just saw it briefly, left one comment about the test. Will review more later.
ivandika3
left a comment
There was a problem hiding this comment.
Thanks @echonesis , overall LGTM. Just left a few comments.
It'll be good if after this is merged you can try this on your cluster.
| if (isCurrentLeaderNode(nodeId)) { | ||
| changeFollowerReadProxy(nodeId); | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Currently, we don't have this logic in the Hadoop RPC follower read since we would like to allow read on leader. For parity purpose, let's remove this and add them together if we want to introduce a follower only strategy.
| inetAddress.getHostName()) | ||
| .run(() -> resp.set(clients.get(host.get()) | ||
| .submitRequest(payload))); | ||
| resp.set(submitRequestToHost(payload, host.get())); |
There was a problem hiding this comment.
There are two AtomicReference set here and in the submitRequestToHost. Can we use the return value of submitRequestToHost directly?
| } | ||
|
|
||
| @Test | ||
| public void testFollowerReadSkipsKnownLeader() throws Exception { |
There was a problem hiding this comment.
This test then can be changed so that if the initial OM is a follower, it will not trigger failover.
What changes were proposed in this pull request?
This PR adds OM follower read support for the gRPC OM transport.
Before this change, OM follower read support was available through the Hadoop RPC transport path, but gRPC clients still used the leader-oriented path for OM requests. This PR extends
GrpcOmTransportso follower-read eligible OM requests can be sent to follower OM nodes when follower read is enabled.The change includes:
Generated-by: OpenAI Codex
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15492
How was this patch tested?
Tested with:
mvn clean test -pl :ozone-common,:ozone-integration-test -am \ -Dtest=TestS3GrpcOmTransport,TestOzoneManagerHAWithAllRunning,TestOzoneManagerHAWithStoppedNodes,TestOzoneManagerHAFollowerReadWithAllRunning,TestOzoneManagerHAFollowerReadWithStoppedNodes,TestOzoneManagerPrepare \ -DskipShade -DskipRecon -DskipDocsGitHub Actions CI: https://github.com/echonesis/ozone/actions/runs/28155889076