Skip to content

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
apache:masterfrom
ss77892:HDDS-16407
Open

HDDS-16407. In OM serialize the Ratis reply eagerly so the retry cache holds bytes, not the OMResponse tree#11234
ss77892 wants to merge 1 commit into
apache:masterfrom
ss77892:HDDS-16407

Conversation

@ss77892

@ss77892 ss77892 commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

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:

instance metric 09-11 16:22 · HDDS-16407c750bd76e8 09-07 22:11 · master@54da65a9d4
node1 gc_count 645.0 965.0
node2 gc_count 648.0 955.0
node3 gc_count 1,329 2,589

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.

…e holds bytes, not the OMResponse tree

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

/** Convert the given proto 2 response to a proto 3 {@link ByteString}. */
/**
* Convert the given proto 2 response to a proto 3 {@link ByteString}.

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.

nit: please change “proto 3 ByteString” to “Ratis Message”, since this method returns Message.

@rich7420 rich7420 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.

overall LGTM

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