HDDS-11853. Avoid redundant UUID conversion in XceiverClientRatis hot path - #11247
Open
lpavanvenkat wants to merge 1 commit into
Open
lpavanvenkat wants to merge 1 commit into
lpavanvenkat wants to merge 1 commit into
Conversation
Contributor
|
@lpavanvenkat please enable CI workflow in your fork branch. |
Author
|
I enabled the CI workflow on my forked branch. |
lpavanvenkat
force-pushed
the
HDDS-11853
branch
from
September 16, 2026 11:15
ad0da43 to
04485ff
Compare
adoroszlai
reviewed
Sep 17, 2026
adoroszlai
left a comment
Contributor
There was a problem hiding this comment.
Thanks @lpavanvenkat for the patch.
| } | ||
| asyncReply.setLogIndex(reply.getLogIndex()); | ||
| addDatanodetoReply(serverId, asyncReply); | ||
| addDatanodetoReply(reply.getReplierId(), asyncReply); |
Contributor
There was a problem hiding this comment.
The reply's list of datanodes is used only for watchForCommit commands, to mark failed nodes:
and
But here the node is added for all kinds of commands and regardless of its result.
Question: is it even necessary to add the datanode here? (I tried removing it and CI passed.)
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?
What and why
XceiverClientRatis.sendCommandAsynccalledRatisHelper.toDatanodeId(reply.getReplierId())on every Ratis reply, which internally parses a UUID string viaUUID.fromString— only to look up aDatanodeDetailsobject that is already available from the pipeline. This is redundant work on the hot write path.Changes
In
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/XceiverClientRatis.java:Map<String, DatanodeDetails>fieldpeerIdToDatanodeis pre-built at construction time frompipeline.getNodes(), keyed by each datanode's UUID string.addDatanodetoReply(String, XceiverClientReply)is added to do a direct map lookup instead of callingRatisHelper.toDatanodeId(which calledUUID.fromString) on every reply.sendCommandAsyncis updated to calladdDatanodetoReply(reply.getReplierId(), ...)directly, removing the intermediateUUID serverIdvariable.The map is always complete: Ozone Ratis pipelines have fixed membership — when a node fails, SCM closes the pipeline and creates a new one. The Ratis peer ID is always
datanode.getUuidString()(RatisHelper.toRaftPeerIdString), the exact key used in the map. A miss is structurally impossible.No changes to
RatisHelper,DatanodeID, or any other class.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-11853
How was this patch tested?
mvn -pl :hdds-client test— 148 tests, all passed../hadoop-ozone/dev-support/checks/checkstyle.sh— 0 violations across all 58 modules.mvn -pl :ozone-integration-test test -Dtest=TestCommitInRatis— 2 tests passed.LOG.infothat everyaddDatanodetoReplycall duringTestCommitInRatisproducedhit=truewith zero fallback UUID parses.No UI changes. No Protobuf changes.