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 2020/12/18 08:05:16 UTC

[GitHub] [ozone] captainzmc commented on a change in pull request #1706: HDDS-4277. Support Bucket Namespace Quota Updates

captainzmc commented on a change in pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#discussion_r545616686



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCreateRequest.java
##########
@@ -308,6 +309,8 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
           new CacheValue<>(Optional.of(omKeyInfo), trxnLogIndex));
 
       omBucketInfo.incrUsedBytes(preAllocatedSpace);
+      // Update namespace quota
+      omBucketInfo.incrUsedNamespace(1L);

Review comment:
       If the key is created successfully, but write failed before the commit key (for example, client crashes), then the key should not be counted. 
   We'd better  incrUsedNamespace(-1L), when we clean up this key in the background.

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
##########
@@ -589,6 +589,25 @@ protected void checkBucketQuotaInBytes(OmBucketInfo omBucketInfo,
     }
   }
 
+  /**
+   * Check namespace quota.
+   */
+  protected void checkBucketQuotaInNamespace(OmBucketInfo omBucketInfo,
+      long allocatedNamespace) throws IOException {
+    if (omBucketInfo.getQuotaInNamespace() != OzoneConsts.QUOTA_RESET) {

Review comment:
       ```suggestion
       if (omBucketInfo.getQuotaInNamespace() > 0) {
   ```
   This unity has been changed: https://github.com/apache/ozone/pull/1677#discussion_r545536353




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

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