-
Notifications
You must be signed in to change notification settings - Fork 594
HDDS-14369. RatisPipelineProvider does not honor OZONE_DATANODE_PIPELINE_LIMIT_DEFAULT #9609
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
Changes from 2 commits
ac97639
6d23d87
227ea7d
5410c56
9c03621
ac32ac4
b1df2ee
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 |
|---|---|---|
|
|
@@ -76,8 +76,9 @@ public PipelinePlacementPolicy(final NodeManager nodeManager, | |
| super(nodeManager, conf); | ||
| this.nodeManager = nodeManager; | ||
| this.stateManager = stateManager; | ||
| String dnLimit = conf.get(ScmConfigKeys.OZONE_DATANODE_PIPELINE_LIMIT); | ||
| this.heavyNodeCriteria = dnLimit == null ? 0 : Integer.parseInt(dnLimit); | ||
| this.heavyNodeCriteria = conf.getInt( | ||
|
||
| ScmConfigKeys.OZONE_DATANODE_PIPELINE_LIMIT, | ||
| ScmConfigKeys.OZONE_DATANODE_PIPELINE_LIMIT_DEFAULT); | ||
| } | ||
|
|
||
| public static int currentRatisThreePipelineCount( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,9 +82,9 @@ public RatisPipelineProvider(NodeManager nodeManager, | |
| this.pipelineNumberLimit = conf.getInt( | ||
| ScmConfigKeys.OZONE_SCM_RATIS_PIPELINE_LIMIT, | ||
| ScmConfigKeys.OZONE_SCM_RATIS_PIPELINE_LIMIT_DEFAULT); | ||
| String dnLimit = conf.get(ScmConfigKeys.OZONE_DATANODE_PIPELINE_LIMIT); | ||
| this.maxPipelinePerDatanode = dnLimit == null ? 0 : | ||
| Integer.parseInt(dnLimit); | ||
| this.maxPipelinePerDatanode = conf.getInt( | ||
|
||
| ScmConfigKeys.OZONE_DATANODE_PIPELINE_LIMIT, | ||
| ScmConfigKeys.OZONE_DATANODE_PIPELINE_LIMIT_DEFAULT); | ||
| this.containerSizeBytes = (long) this.conf.getStorageSize( | ||
| ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE, | ||
| ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE_DEFAULT, | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2055,6 +2055,29 @@ public void testScmRegisterNodeWithUpdatedIpAndHostname() | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Test that pipelineLimit() uses the default value when the config is not set. | ||||||
| */ | ||||||
| @Test | ||||||
| public void testPipelineLimitDefaultIsTwoWhenUnset() | ||||||
|
||||||
| throws IOException, AuthenticationException { | ||||||
|
|
||||||
| // Creates node manager with config without limit set | ||||||
| OzoneConfiguration conf = getConf(); | ||||||
| conf.unset(ScmConfigKeys.OZONE_DATANODE_PIPELINE_LIMIT); | ||||||
|
|
||||||
| try (SCMNodeManager nodeManager = createNodeManager(conf)) { | ||||||
|
|
||||||
| // Registers datanode with healthy volumes | ||||||
| DatanodeDetails dn = registerWithCapacity(nodeManager); | ||||||
|
|
||||||
| // Calls pipelineLimit() and verifies returns 2 | ||||||
|
||||||
| // Calls pipelineLimit() and verifies returns 2 | |
| // Calls pipelineLimit() and verifies returns default value |
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 assertion is redundant. The first assertion itself is enough to check that it picks the default value.
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.
The existing field name
heavyNodeCriteriais quite creative but unclear what does it mean. Could you rename it todatanodePipelineLimit?