-
Notifications
You must be signed in to change notification settings - Fork 593
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
Conversation
…INE_LIMIT_DEFAULT
Gargi-jais11
left a comment
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.
Thanks @Russole for working on the patch.
There are two more classes where OZONE_DATANODE_PIPELINE_LIMIT_DEFAULT value should be used instead of 0.
SCMNodeManager : https://github.com/Gargi-jais11/ozone/blob/64bb019407bc001fbe2c6339141908c3e7d59b8f/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java#L198-L199
PipelinePlacementPolicy : https://github.com/Gargi-jais11/ozone/blob/64bb019407bc001fbe2c6339141908c3e7d59b8f/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelinePlacementPolicy.java#L79-L80
Each layer needs the correct default value because they all independently read the configuration and use it in different ways. Fixing only one would leave inconsistencies in the others, causing incorrect behavior.
|
It is also good if you add test cases for this part in 2. PipelinePlacementPolicy 3. SCMNodeManager |
|
Thanks @Gargi-jais11 for the reviews. I’ve addressed the comments and updated the patch accordingly. |
Gargi-jais11
left a comment
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.
Thank @Russole for updating the patch. Please fine some more comments inlined.
| int limit = nodeManager.pipelineLimit(dn); | ||
| assertEquals(ScmConfigKeys.OZONE_DATANODE_PIPELINE_LIMIT_DEFAULT, limit); | ||
| assertEquals(2, limit); |
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.
| // Registers datanode with healthy volumes | ||
| DatanodeDetails dn = registerWithCapacity(nodeManager); | ||
|
|
||
| // Calls pipelineLimit() and verifies returns 2 |
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.
| // Calls pipelineLimit() and verifies returns 2 | |
| // Calls pipelineLimit() and verifies returns default value |
| * Test that pipelineLimit() uses the default value when the config is not set. | ||
| */ | ||
| @Test | ||
| public void testPipelineLimitDefaultIsTwoWhenUnset() |
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.
rename it as something more generic:testUsesDefaultPipelineLimitWhenUnset()
|
@szetszwo Please review this patch. |
szetszwo
left a comment
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.
@Russole , thanks for working on this! The change looks good. Just have some comments on the existing names.
| ScmConfigKeys.OZONE_SCM_PIPELINE_PER_METADATA_VOLUME_DEFAULT); | ||
| String dnLimit = conf.get(ScmConfigKeys.OZONE_DATANODE_PIPELINE_LIMIT); | ||
| this.heavyNodeCriteria = dnLimit == null ? 0 : Integer.parseInt(dnLimit); | ||
| this.heavyNodeCriteria = conf.getInt( |
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 heavyNodeCriteria is quite creative but unclear what does it mean. Could you rename it to datanodePipelineLimit?
| String dnLimit = conf.get(ScmConfigKeys.OZONE_DATANODE_PIPELINE_LIMIT); | ||
| this.maxPipelinePerDatanode = dnLimit == null ? 0 : | ||
| Integer.parseInt(dnLimit); | ||
| this.maxPipelinePerDatanode = conf.getInt( |
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 also rename it to datanodePipelineLimit. So it is easier to tell that they are the same thing.
|
This issue is related to #9580 |
|
Thanks @szetszwo and @jojochuang for the review. I’ve updated the implementation based on the comments. |
| this.stateManager = stateManager; | ||
| String dnLimit = conf.get(ScmConfigKeys.OZONE_DATANODE_PIPELINE_LIMIT); | ||
| this.heavyNodeCriteria = dnLimit == null ? 0 : Integer.parseInt(dnLimit); | ||
| this.heavyNodeCriteria = conf.getInt( |
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.
@Russole , there is one more field to rename.
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.
Thanks for the reminder.
szetszwo
left a comment
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.
+1 the change looks good
Gargi-jais11
left a comment
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.
LGTM
What changes were proposed in this pull request?
OZONE_DATANODE_PIPELINE_LIMITconf.getInt(..., DEFAULT)instead of falling back to 0 when the config is unsetOZONE_DATANODE_PIPELINE_LIMIT_DEFAULT(default = 2)What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14369
How was this patch tested?
All CI checks passed.
https://github.com/Russole/ozone/actions/runs/20823196572