sodonnel opened a new pull request #3147:
URL: https://github.com/apache/ozone/pull/3147


   ## What changes were proposed in this pull request?
   
   The current container report handling logic in 
AbstractContainerReportHandler does not update the container usage and key 
count correctly in SCM for EC containers. The current logic says:
   
   ```
   for (ContainerReplica r : otherReplicas) {
     // Open containers are generally growing in key count and size, the
     // overall size should be the min of all reported replicas.
     if (containerInfo.getState().equals(HddsProtos.LifeCycleState.OPEN)) {
       usedBytes = Math.min(usedBytes, r.getBytesUsed());
       keyCount = Math.min(keyCount, r.getKeyCount());
     } else {
       // Containers which are not open can only shrink in size, so use the
       // largest values reported.
       usedBytes = Math.max(usedBytes, r.getBytesUsed());
       keyCount = Math.max(keyCount, r.getKeyCount());
     }
   } 
   ```
   
   For EC Containers, the bytes used will be different across all the replicas 
due to partial stripes. The first data replica and the parity replicas should 
have the max size, but other data replicas are likely to be smaller. Therefore 
using the min as above will not work.
   
   We should base the EC calculation on the min of the first data and parity 
group, and ignore the usage in the other replicas.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-6384
   
   ## How was this patch tested?
   
   New unit tests added
   


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