Repository navigation
Conversation
…g Ratis blocks Add hdds.scm.block.allocation.prefer.client.local (default false). When set, OM passes the client address to SCM on every block allocation and SCM tries open pipelines that contain the client's datanode before the pipeline choose policy, like the HDFS writer-local first replica. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…er local pipelines Ratis writes go through the leader, so a pipeline led by the writer's datanode keeps the client-to-leader hop on the same host. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… client local is set Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
smengcl
commented
Oct 18, 2026
Comment on lines
+105
to
+114
| @Config(key = "hdds.scm.block.allocation.prefer.client.local", | ||
| type = ConfigType.BOOLEAN, | ||
| defaultValue = "false", | ||
| tags = { ConfigTag.SCM, ConfigTag.PIPELINE, ConfigTag.PERFORMANCE }, | ||
| description = "If true, when allocating a Ratis block for a client that runs on a datanode host, SCM prefers " | ||
| + "an open pipeline that contains that datanode, so one replica is local to the writer (like the HDFS " | ||
| + "first replica). Falls back to the pipeline choose policy when no such pipeline has a usable container. " | ||
| + "OM reads the same key to pass the client address to SCM on every block allocation." | ||
| ) | ||
| private boolean preferClientLocalPipeline; |
Contributor
Author
There was a problem hiding this comment.
Open question to reviewers: Should this be made the default?
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.
Generated-by: Claude Code (Opus 5.5)
What changes were proposed in this pull request?
When a client runs on a datanode host (for example an HBase RegionServer colocated with a datanode), SCM picks a Ratis pipeline for a new block without looking at where the client is, so often no replica is local to the writer. HDFS writes the first replica on the writer's datanode, which later lets reads of that data (such as HBase compactions) use short circuit reads.
This change adds
hdds.scm.block.allocation.prefer.client.local(defaultfalse). When it is set:EC allocation and the default behavior are unchanged.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-17113
How was this patch tested?
TestWritableRatisContainerProvider(prefers a pipeline led by the client, then one containing it, and falls back when the local pipeline has no container or the client is in no pipeline) and inTestOMAllocateBlockRequest(OM sends the client address to SCM when the flag is set).TestSCMBlockProtocolServer,TestBlockManager,TestOMKeyCreateRequestandTestOMFileCreateRequestpass.🤖 Generated with Claude Code