siddhantsangwan commented on PR #4539:
URL: https://github.com/apache/ozone/pull/4539#issuecomment-1498779490

   Going through this code in `SCMCommonPlacementPolicy`:
   ```
     public ContainerPlacementStatus validateContainerPlacement(
         List<DatanodeDetails> dns, int replicas) {
       NetworkTopology topology = nodeManager.getClusterNetworkTopologyMap();
       // We have a network topology so calculate if it is satisfied or not.
       int requiredRacks = getRequiredRackCount(replicas);
       int numRacks = topology != null ? topology.getRackCount() : 1;
       if (numRacks == 1 || replicas == 1 || requiredRacks == 1) {
         if (dns.size() > 0) {
           // placement is always satisfied if there is at least one DN.
           return validPlacement;
         } else {
           return invalidPlacement;
         }
       }
   ```
   
   I'm wondering if `getRequiredRackCount(replicas)` should return 1 instead of 
2 in this case? Currently in `SCMContainerPlacementRackAware` the constant 
value `REQUIRED_RACKS`, which is 2, is returned.


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