You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/04/26 13:21:49 UTC

[GitHub] [ozone] captainzmc commented on a diff in pull request #3286: HDDS-6556. Check quota while allocate and update usedBytes when commit.

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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org