captainzmc commented on code in PR #3286:
URL: https://github.com/apache/ozone/pull/3286#discussion_r858706851


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadCommitPartRequest.java:
##########
@@ -226,15 +226,9 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
           new CacheKey<>(openKey),
           new CacheValue<>(Optional.absent(), trxnLogIndex));
 
-      long scmBlockSize = ozoneManager.getScmBlockSize();
-      int factor = omKeyInfo.getReplicationConfig().getRequiredNodes();
       omBucketInfo = getBucketInfo(omMetadataManager, volumeName, bucketName);
-      // Block was pre-requested and UsedBytes updated when createKey and
-      // AllocatedBlock. The space occupied by the Key shall be based on
-      // the actual Key size, and the total Block size applied before should
-      // be subtracted.
-      long correctedSpace = omKeyInfo.getReplicatedSize() -
-          keyArgs.getKeyLocationsList().size() * scmBlockSize * factor;
+
+      long correctedSpace = omKeyInfo.getReplicatedSize();
       omBucketInfo.incrUsedBytes(correctedSpace);

Review Comment:
   > Should check quota and also increase usedNamespace when commit.
   > Oops, if it's a multi-part key, where does usedNamespace get increased?
   
   It seems S3MultipartUpload support for Quota has some bugs and lacks some 
UT.  This PR we modified the calculation method of correctedSpace first. And I 
opened a new JIRA HDDS-6650. I will check and fix all the problems of 
S3MultipartUpload Quota in the next PR, and add some new UT.



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