sodonnel commented on code in PR #4061:
URL: https://github.com/apache/ozone/pull/4061#discussion_r1048990260
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/SCMContainerPlacementRackScatter.java:
##########
@@ -335,9 +335,22 @@ protected List<DatanodeDetails> chooseDatanodesInternal(
.flatMap(List::stream).collect(Collectors.toList()),
requiredReplicationFactor);
if (!placementStatus.isPolicySatisfied()) {
- String errorMsg = "ContainerPlacementPolicy not met. Misreplication" +
- " Reason: " + placementStatus.misReplicatedReason();
- throw new SCMException(errorMsg, null);
+ ContainerPlacementStatus initialPlacementStatus =
+ validateContainerPlacement(
+ Stream.of(usedNodes)
+ .flatMap(List::stream).collect(Collectors.toList()),
+ requiredReplicationFactor);
+ if (initialPlacementStatus.misReplicationCount()
+ < placementStatus.misReplicationCount()) {
+ String errorMsg = "ContainerPlacementPolicy not met. Misreplication" +
+ " Reason: " + placementStatus.misReplicatedReason() +
+ " Initial Used nodes mis-replication Count: " +
+ initialPlacementStatus.misReplicationCount() +
+ " Used nodes + Chosen nodes mis-replication Count: " +
+ placementStatus.misReplicationCount();
+ throw new SCMException(errorMsg, null);
Review Comment:
Should this error have code "FAILED_TO_FIND_SUITABLE_NODE" instead of null?
I guess we found a node, and it doesn't meet the policy, so I guess it is a
failure to find a suitable node.
These codes are not really used much now, but we might be able to use them
later.
--
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]