Repository navigation
Conversation
Batch plain follower reads on the server executor with configurable batch size and bounded in-flight concurrency. Keep batching disabled by default, preserve read-after-write handling, and settle outstanding requests on shutdown.
This branch has not been deployed
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?
Generated-by: GPT 6.1 Sol (PR description is hand-written).
Please see https://issues.apache.org/jira/browse/RATIS-2524 for the background. This improves on the the previous ReadIndex batching #1455 implementation by using natural / continuous / automatic batching (I will use natural batching from now on) instead of a fixed read batch size and interval.
The main class of the implementation is the
ReadIndexBatching.Follower read flows
ReadRequestHandler#sendReadIndexAsyncrequests a ReadIndex by callingReadIndexBatching#submit.ReadIndexBatchingadds the pending ReadIndex invocation to itspendingcall and immediately scheduledrain(i.e. natural batching will not wait until the batch size reaches a certain size and send as fast as possible to reduce the latency).drainwill send aReadIndexRPC to the leader and wait for the results.ReadIndexRPC is retrieved,ReadIndexBatchingwill complete theCompletable<ReadIndexReplyProto>that the clients are waiting forReadIndexbarrier has finished and proceed to read locallyDesign decisions
Advantages
Drawbacks
Performance results
We saw sizeable improvements in the follower read throughput (although it's still well below the leader read performance) on Ozone Manager.
Setup
Cluster
readIndexAsyncthat was introduced in RATIS-2831. Separate the ReadIndex barrier and read executions #1707raft.server.read.leader.heartbeat-check.enabled=false: Leadership heartbeat check disabledraft.server.read.read-index.type=APPLIED_INDEX: Use appliedIndex as read index to reduce apply latencyraft.server.read.read-index.batch.enabled=true: Enable ReadIndexBatchResults
READ_KEYREAD_KEYREAD_KEYCREATE_KEY,READ_KEY 10%,90%CREATE_KEY,READ_KEY 10%,90%CREATE_KEY,READ_KEY 10%,90%CREATE_KEY,READ_KEY 30%,70%CREATE_KEY,READ_KEY 30%,70%CREATE_KEY,READ_KEY 30%,70%CREATE_KEY,READ_KEY 90%,10%CREATE_KEY,READ_KEY 90%,10%CREATE_KEY,READ_KEY 90%,10%CREATE_KEY,READ_KEY 70%,30%CREATE_KEY,READ_KEY 70%,30%CREATE_KEY,READ_KEY 70%,30%CREATE_KEYCREATE_KEYCREATE_KEYCREATE_KEY,LIST_KEYS 10%,90%CREATE_KEY,LIST_KEYS 10%,90%CREATE_KEY,LIST_KEYS 10%,90%CREATE_KEY,LIST_KEYS 30%,70%CREATE_KEY,LIST_KEYS 30%,70%CREATE_KEY,LIST_KEYS 30%,70%CREATE_KEY,LIST_KEYS 90%,10%CREATE_KEY,LIST_KEYS 90%,10%CREATE_KEY,LIST_KEYS 90%,10%CREATE_KEY,LIST_KEYS 70%,30%CREATE_KEY,LIST_KEYS 70%,30%CREATE_KEY,LIST_KEYS 70%,30%LIST_KEYSLIST_KEYSLIST_KEYSEvaluation
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/RATIS-2524
How was this patch tested?
UT, IT.