swamirishi commented on code in PR #4061:
URL: https://github.com/apache/ozone/pull/4061#discussion_r1049020414


##########
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:
   done



-- 
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]

Reply via email to