Skip to content

HDDS-15492. Support OM follower read for gRPC client#10591

Open
echonesis wants to merge 1 commit into
apache:masterfrom
echonesis:HDDS-15492
Open

HDDS-15492. Support OM follower read for gRPC client#10591
echonesis wants to merge 1 commit into
apache:masterfrom
echonesis:HDDS-15492

Conversation

@echonesis

Copy link
Copy Markdown
Contributor

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 GrpcOmTransport so follower-read eligible OM requests can be sent to follower OM nodes when follower read is enabled.

The change includes:

  • Applying the configured default read consistency hint for gRPC OM requests.
  • Routing follower-read eligible read requests to non-leader OM nodes.
  • Falling back to the leader path when follower read cannot be served by a follower.
  • Reusing OM failover exception handling for follower read failures.
  • Configuring per-OM gRPC ports in the HA mini cluster.
  • Adding unit and integration coverage for gRPC follower read behavior.

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

GitHub Actions CI: https://github.com/echonesis/ozone/actions/runs/28010968668

@ivandika3 ivandika3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @echonesis , just saw it briefly, left one comment about the test. Will review more later.

Comment on lines +579 to +583
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());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants