pratapchandu commented on code in PR #3847:
URL: https://github.com/apache/ozone/pull/3847#discussion_r998926440
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelinePlacementPolicy.java:
##########
@@ -124,6 +124,15 @@ List<DatanodeDetails> filterViableNodes(
// get nodes in HEALTHY state
List<DatanodeDetails> healthyNodes =
nodeManager.getNodes(NodeStatus.inServiceHealthy());
+ if (healthyNodes.size() < nodesRequired) {
Review Comment:
Existing code is not checking required condition healthyNodes.size() <
nodesRequired (where new check was added in the current change) before calling
filterNodesWithSpace.
filterNodesWithSpace checking the condition and throwing the exception with
code FAILED_TO_FIND_NODES_WITH_SPACE.
[ozone/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineCreateAndDestroy.java](https://github.com/apache/ozone/blob/4454e6b368bc5aedaba509eeb85422daeda393bf/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineCreateAndDestroy.java#L148-L149)
Test is failing with the following assert failure :
[ERROR]
org.apache.hadoop.hdds.scm.pipeline.TestRatisPipelineCreateAndDestroy.testPipelineCreationOnNodeRestart
Time elapsed: 55.337 s <<< FAILURE!
java.lang.AssertionError: expected:<FAILED_TO_FIND_SUITABLE_NODE> but
was:<FAILED_TO_FIND_NODES_WITH_SPACE>
at org.junit.Assert.fail(Assert.java:89)
at org.junit.Assert.failNotEquals(Assert.java:835)
at org.junit.Assert.assertEquals(Assert.java:120)
at org.junit.Assert.assertEquals(Assert.java:146)
at
org.apache.hadoop.hdds.scm.pipeline.TestRatisPipelineCreateAndDestroy.testPipelineCreationOnNodeRestart(TestRatisPipelineCreateAndDestroy.java:146
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]