HDDS-16407. In OM serialize the Ratis reply eagerly so the retry cache holds bytes, not the OMResponse tree - #11234
Open
ss77892 wants to merge 1 commit into
Open
HDDS-16407. In OM serialize the Ratis reply eagerly so the retry cache holds bytes, not the OMResponse tree#11234ss77892 wants to merge 1 commit into
ss77892 wants to merge 1 commit into
Conversation
…e holds bytes, not the OMResponse tree Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
rich7420
reviewed
Sep 13, 2026
|
|
||
| /** Convert the given proto 2 response to a proto 3 {@link ByteString}. */ | ||
| /** | ||
| * Convert the given proto 2 response to a proto 3 {@link ByteString}. |
Contributor
There was a problem hiding this comment.
nit: please change “proto 3 ByteString” to “Ratis Message”, since this method returns Message.
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?
In OM serialize the Ratis reply eagerly so the retry cache holds bytes, not the OMResponse tree
OMRatisHelper.convertResponseToMessage returned a lambda Message that captured the parsed OMResponse and serialized it on every getContent() call. Ratis keeps the reply Message of every applied write in its retry cache, on the leader and on every follower, for the retry cache timeout, and the cache has no size bound. So under a write burst each OM retained the whole parsed response tree (KeyInfo, locations, ACLs) per request for that long, and re-serialized it each time the content was read.
Serialize once, up front, and hand Ratis a Message that holds only the bytes. Same bytes on the wire and in the cache, so retried requests are still answered from the retry cache exactly as before.
Comparison to master on freon omkg workload with 1m keys. OM instances have 3gb heap size:
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16407
How was this patch tested?
UT
Benchmark on 3 node cluster using freon omkg.