kaijchen commented on code in PR #3882:
URL: https://github.com/apache/ozone/pull/3882#discussion_r1004371620


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java:
##########
@@ -93,16 +93,13 @@ public WritableECContainerProvider(ConfigurationSource conf,
   public ContainerInfo getContainer(final long size,
       ECReplicationConfig repConfig, String owner, ExcludeList excludeList)
       throws IOException, TimeoutException {
-    // Bound this at a minimum of 1 byte in case a request is made for a very
-    // small size, which when divided by EC DataNum is zero.
-    long requiredSpace = Math.max(1, size / repConfig.getData());
     synchronized (this) {
       int openPipelineCount = pipelineManager.getPipelineCount(repConfig,
           Pipeline.PipelineState.OPEN);
       if (openPipelineCount < providerConfig.getMinimumPipelines()) {
         try {
           return allocateContainer(
-              repConfig, requiredSpace, owner, excludeList);
+              repConfig, size, owner, excludeList);

Review Comment:
   > https://github.com/apache/ozone/pull/3194#discussion_r826944617
   > For EC we are allocating in "ec block" chunks, which is always 256 * 5 
(rs-3-2). We are not allocating in 256MB chunks. The code 
allocatedLocationInfoList.size() should be returning the number of EC Block 
groups allocated.
   
   If I understand correctly, we should either pass the `requested data size` 
to `allocateBlock()` and devide it inside `WritableECContainerProvider`,
   or pass `requested data size / numData` to `allocateBlock()` and use the raw 
value in `WritableECContainerProvider`.
   
   Based on the definition of `OMAllocateBlockRequest`, seems the first 
approach is the correct one?
   



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