HDDS-14509. Allow client to choose the read consistency level#9796
Draft
ivandika3 wants to merge 3 commits intoapache:masterfrom
Draft
HDDS-14509. Allow client to choose the read consistency level#9796ivandika3 wants to merge 3 commits intoapache:masterfrom
ivandika3 wants to merge 3 commits intoapache:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ReadConsistencyHintfield inOMRequestwhich allows client to hint to the OM about what the read consistency the client wants. However, for compatibility reasons, the clientReadConsistencyHintis 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