Skip to content

HDDS-14509. Allow client to choose the read consistency level#9796

Draft
ivandika3 wants to merge 3 commits intoapache:masterfrom
ivandika3:HDDS-14509
Draft

HDDS-14509. Allow client to choose the read consistency level#9796
ivandika3 wants to merge 3 commits intoapache:masterfrom
ivandika3:HDDS-14509

Conversation

@ivandika3
Copy link
Contributor

@ivandika3 ivandika3 commented Feb 20, 2026

What changes were proposed in this pull request?

Currently, if OM follower read is enabled, all OM followers will serve read requests even if the client does not enable the follower read.

For leader-only client, this might be unexpected since they expect the OM follower to throw OMNotLeaderException.

We can support some kind of OM request metadata to indicate to the OM whether the client enables the follower read or not.

The implementation introduces ReadConsistencyHint field in OMRequest which allows client to hint to the OM about what the read consistency the client wants. However, for compatibility reasons, the client ReadConsistencyHint is only supported by OM in a best-effort basis. For example, if the new client sends the hint to old OM that does not support it or OM that disables linearizable read, the OM can choose not to respect the read consistency.

Currently, client can configure the default leader and follower read consistency which applies to corresponding requests. However, the long term idea is to allow client to specify per-request consistency requirements. For example in S3 use cases, client can use custom header (e.g. "x-ozone-read-consistency") to pick the desired consistency.

The idea of client-defined consistency level is inspired by other systems:

Note: Since this changes require changes in protobuf definition and possibly user-facing read consistency level. Thorough reviews and suggestions are greatly appreciated. (Edit: Currently putting this to Draft first until the proto and API changes are finalized since IMO the API and proto changes are still slightly awkward).

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14509

How was this patch tested?

IT.

Clean CI run: https://github.com/ivandika3/ozone/actions/runs/22216665699

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.

1 participant

Comments