-
Notifications
You must be signed in to change notification settings - Fork 594
HDDS-13579. [Docs] Explain how Ratis write pipelines are calculated #9580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -69,6 +69,64 @@ Ratis handles concurrent logs per node. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This property is effective only when the previous property is set to 0. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The value of this property must be greater than 0. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### Calculating Ratis Pipeline Limits | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The target number of open, FACTOR_THREE Ratis pipelines is controlled by three properties that define the maximum | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| number of pipelines in the cluster at a cluster-wide level, datanode level, and metadata disk level, respectively. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SCM will create pipelines until the most restrictive limit is met. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1. **Cluster-wide Limit (`ozone.scm.ratis.pipeline.limit`)** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * **Description**: An absolute, global limit for the total number of open, FACTOR_THREE Ratis pipelines | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (pipelineNumberLimit > 0) { | |
| int factorOnePipelineCount = pipelineStateManager | |
| .getPipelines(RatisReplicationConfig.getInstance(ReplicationFactor.ONE)).size(); | |
| int allowedOpenPipelines = pipelineNumberLimit - factorOnePipelineCount; | |
| return openPipelines >= allowedOpenPipelines; | |
| } |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... no global limit is enforced by default).
no global limit by default).
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the sentence "This is one of two ways to calculate a cluster-wide target." since the Dynamic Limit
is not used in RatisPipelineProvider.exceedPipelineNumberLimit(..).
szetszwo marked this conversation as resolved.
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* **Cluster-wide Limit Calculation**: If this property is set,
the number of pipelines in the cluster is in addition limited by
`(<this value> * <number of healthy datanodes>) / 3`.(revised)
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... This property is used ... is explicitly set to
0.
This property takes effect ... is not set to a positive number.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this section since it seems not true (or I cannot find the code enforcing it). I do see that the value is used for filtering datanodes.
Lines 104 to 131 in 4fd8360
| private boolean exceedPipelineNumberLimit(RatisReplicationConfig replicationConfig) { | |
| // Apply limits only for replication factor THREE | |
| if (replicationConfig.getReplicationFactor() != ReplicationFactor.THREE) { | |
| return false; | |
| } | |
| PipelineStateManager pipelineStateManager = getPipelineStateManager(); | |
| int totalActivePipelines = pipelineStateManager.getPipelines(replicationConfig).size(); | |
| int closedPipelines = pipelineStateManager.getPipelines(replicationConfig, PipelineState.CLOSED).size(); | |
| int openPipelines = totalActivePipelines - closedPipelines; | |
| // Check per-datanode pipeline limit | |
| if (maxPipelinePerDatanode > 0) { | |
| int healthyNodeCount = getNodeManager() | |
| .getNodeCount(NodeStatus.inServiceHealthy()); | |
| int allowedOpenPipelines = (maxPipelinePerDatanode * healthyNodeCount) | |
| / replicationConfig.getRequiredNodes(); | |
| return openPipelines >= allowedOpenPipelines; | |
| } | |
| // Check global pipeline limit | |
| if (pipelineNumberLimit > 0) { | |
| int factorOnePipelineCount = pipelineStateManager | |
| .getPipelines(RatisReplicationConfig.getInstance(ReplicationFactor.ONE)).size(); | |
| int allowedOpenPipelines = pipelineNumberLimit - factorOnePipelineCount; | |
| return openPipelines >= allowedOpenPipelines; | |
| } | |
| // No limits are set | |
| return false; | |
| } |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think NumOpenPipelines metrics doesn't exist. We can either use admin command to see number of open pipelines or may use recon as well to see the open pipelines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify, the SCM web UI has a section Pipeline Statistics, and it pulls the metrics from:
{
"name": "Hadoop:service=SCMPipelineManager,name=SCMPipelineManagerInfo",
"modelerType": "org.apache.hadoop.hdds.scm.pipeline.PipelineManagerImpl",
"PipelineInfo": [
{
"key": "CLOSED",
"value": 0
},
{
"key": "ALLOCATED",
"value": 0
},
{
"key": "OPEN",
"value": 1
},
{
"key": "DORMANT",
"value": 0
}
]
},
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use ReplicationFactor.THREE, which is a client API.
three configuration properties ... that limit the