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.
| void testGrpcClientFollowerReadTargetsFollower() throws Exception { | ||
| OzoneConfiguration clientConf = new OzoneConfiguration(getConf()); | ||
| clientConf.setBoolean(OZONE_CLIENT_FOLLOWER_READ_ENABLED_KEY, true); | ||
| clientConf.set(OZONE_CLIENT_FOLLOWER_READ_DEFAULT_CONSISTENCY_KEY, "LOCAL_LEASE"); | ||
| clientConf.set(OZONE_OM_TRANSPORT_CLASS, GrpcOmTransportFactory.class.getName()); |
There was a problem hiding this comment.
Instead of adding a test case, how about we make the test parameterized over the OZONE_OM_TRANSPORT_CLASS for gRPC and Hadoop client so we can see that both will work the same. Not sure how complicated it is.
There was a problem hiding this comment.
Thanks @ivandika3
Yes, parameterizing this test over OZONE_OM_TRANSPORT_CLASS looks feasible if we keep the scope at the test-method level.
The cluster is already started with follower read enabled, and the follower-read setup also enables the gRPC OM server, so we do not need to rebuild the cluster per transport. I can create a fresh client inside the test with OZONE_OM_TRANSPORT_CLASS set to either Hadoop3OmTransportFactory or GrpcOmTransportFactory, then run the same read path for both.
I would avoid parameterizing the whole test class because many existing tests use the shared client/objectStore initialized in @BeforeAll and some of them assert Hadoop RPC proxy-provider internals. That would require a broader lifecycle refactor and would make unrelated tests run twice.
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/28010968668