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/16 00:32:08 UTC

[GitHub] [ozone] amaliujia opened a new pull request #1706: HDDS-4277. Support Bucket Namespace

amaliujia opened a new pull request #1706:
URL: https://github.com/apache/ozone/pull/1706


   ## What changes were proposed in this pull request?
   
   add namespaceQuotaUsage and update it when create and delete key in a bucket
   
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-4277
   
   ## How was this patch tested?
   
   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.

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


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

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#discussion_r547437679



##########
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:
       Got it. Have filed a jira to track it: https://issues.apache.org/jira/browse/HDDS-4120

##########
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:
       Done!




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


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

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#discussion_r546975199



##########
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:
       @captainzmc  do you have an idea how does the background cleanup happen on keys that failed to commit?




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


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

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#discussion_r545469445



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequest.java
##########
@@ -299,6 +299,10 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
 
       omBucketInfo.incrUsedBytes(preAllocatedSpace);
 
+      // Update namespace quota
+      checkBucketQuotaInNamespace(omBucketInfo, 1L);
+      omBucketInfo.incrUsedNamespace(1L);

Review comment:
       O I see. 




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


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

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#discussion_r547437679



##########
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:
       Got it. Have filed a jira to track it: https://issues.apache.org/jira/browse/HDDS-4620




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


[GitHub] [ozone] amaliujia commented on pull request #1706: HDDS-4277. Support Bucket Namespace

Posted by GitBox <gi...@apache.org>.
amaliujia commented on pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#issuecomment-745685280


   R @captainzmc 


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


[GitHub] [ozone] captainzmc merged pull request #1706: HDDS-4277. Support Bucket Namespace Quota Updates

Posted by GitBox <gi...@apache.org>.
captainzmc merged pull request #1706:
URL: https://github.com/apache/ozone/pull/1706


   


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


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

Posted by GitBox <gi...@apache.org>.
linyiqun commented on a change in pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#discussion_r545533657



##########
File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java
##########
@@ -961,19 +960,18 @@ public void testBucketUsedNamespace() throws IOException {
 
     try {
       writeKey(bucket, key3, ONE, value, value.length());
+      Assert.fail("Write key should be failed");
     } catch (IOException ex) {
-      countException++;
       GenericTestUtils.assertExceptionContains("QUOTA_EXCEEDED", ex);
     }
 
-    // Write failed, bucket usedBytes should remain as 1
+    // Write failed, bucket usedBytes should remain as 2

Review comment:
       Nit: usedBytes -> usedNamespace




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


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

Posted by GitBox <gi...@apache.org>.
linyiqun commented on a change in pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#discussion_r545145014



##########
File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java
##########
@@ -932,6 +932,50 @@ public void testVolumeUsedNamespace() throws IOException {
     Assert.assertEquals(0L, volume.getUsedNamespace());
   }
 
+  @Test
+  public void testBucketUsedNamespace() throws IOException {
+    String volumeName = UUID.randomUUID().toString();
+    String bucketName = UUID.randomUUID().toString();
+    String key1 = UUID.randomUUID().toString();
+    String key2 = UUID.randomUUID().toString();
+    String key3 = UUID.randomUUID().toString();
+    OzoneVolume volume = null;
+    OzoneBucket bucket = null;
+
+    String value = "sample value";
+    int countException = 0;
+
+    store.createVolume(volumeName);
+    volume = store.getVolume(volumeName);
+    volume.createBucket(bucketName);
+    bucket = volume.getBucket(bucketName);
+    bucket.setQuota(OzoneQuota.parseQuota(Long.MAX_VALUE + " Bytes", 2));
+
+    writeKey(bucket, key1, ONE, value, value.length());
+    Assert.assertEquals(1L,
+        store.getVolume(volumeName).getBucket(bucketName).getUsedNamespace());
+
+    writeKey(bucket, key2, ONE, value, value.length());
+    Assert.assertEquals(2L,
+        store.getVolume(volumeName).getBucket(bucketName).getUsedNamespace());
+
+    try {
+      writeKey(bucket, key3, ONE, value, value.length());
+    } catch (IOException ex) {
+      countException++;

Review comment:
       countException is not actually needed, we could add fail() after writeKey and ensure this exception should be happened.
   ```java
    try {
         writeKey(bucket, key3, ONE, value, value.length());
         Assert.fail("Write key should be failed")
       } catch (IOException ex) {
   ```

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCreateRequest.java
##########
@@ -309,6 +309,10 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
 
       omBucketInfo.incrUsedBytes(preAllocatedSpace);
 
+      // Update namespace quota
+      checkBucketQuotaInNamespace(omBucketInfo, 1L);

Review comment:
       Same comment like above.

##########
File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java
##########
@@ -932,6 +932,50 @@ public void testVolumeUsedNamespace() throws IOException {
     Assert.assertEquals(0L, volume.getUsedNamespace());
   }
 
+  @Test
+  public void testBucketUsedNamespace() throws IOException {
+    String volumeName = UUID.randomUUID().toString();
+    String bucketName = UUID.randomUUID().toString();
+    String key1 = UUID.randomUUID().toString();
+    String key2 = UUID.randomUUID().toString();
+    String key3 = UUID.randomUUID().toString();
+    OzoneVolume volume = null;
+    OzoneBucket bucket = null;
+
+    String value = "sample value";
+    int countException = 0;
+
+    store.createVolume(volumeName);
+    volume = store.getVolume(volumeName);
+    volume.createBucket(bucketName);
+    bucket = volume.getBucket(bucketName);
+    bucket.setQuota(OzoneQuota.parseQuota(Long.MAX_VALUE + " Bytes", 2));
+
+    writeKey(bucket, key1, ONE, value, value.length());
+    Assert.assertEquals(1L,
+        store.getVolume(volumeName).getBucket(bucketName).getUsedNamespace());
+
+    writeKey(bucket, key2, ONE, value, value.length());
+    Assert.assertEquals(2L,
+        store.getVolume(volumeName).getBucket(bucketName).getUsedNamespace());
+
+    try {
+      writeKey(bucket, key3, ONE, value, value.length());
+    } catch (IOException ex) {
+      countException++;
+      GenericTestUtils.assertExceptionContains("QUOTA_EXCEEDED", ex);
+    }
+
+    // Write failed, bucket usedBytes should remain as 1
+    Assert.assertEquals(2L,

Review comment:
       This comment should be updated

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequest.java
##########
@@ -299,6 +299,10 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
 
       omBucketInfo.incrUsedBytes(preAllocatedSpace);
 
+      // Update namespace quota
+      checkBucketQuotaInNamespace(omBucketInfo, 1L);
+      omBucketInfo.incrUsedNamespace(1L);

Review comment:
       We should move checkBucketQuotaInNamespace check after checkBucketQuotaInBytes. Here we add cache entry before quota check, this will lead the dirty data.




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


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

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#discussion_r547437679



##########
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:
       Got it. Have filed a jira to track it: https://issues.apache.org/jira/browse/HDDS-4620




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


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

Posted by GitBox <gi...@apache.org>.
captainzmc commented on a change in pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#discussion_r547148550



##########
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:
       There is a PR #1511 currently cleaning open key. I think we can use this. Update quota during cleanup.
   But this PR is not merged yet, and we do not need to block here. We can fix this after #1511 is merged.




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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
amaliujia commented on pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#issuecomment-747814719


   @captainzmc @linyiqun comments addressed. Can you take a another look please?


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


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

Posted by GitBox <gi...@apache.org>.
captainzmc commented on a change in pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#discussion_r545618208



##########
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() > OzoneConsts.QUOTA_RESET) {
   ```
   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


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

Posted by GitBox <gi...@apache.org>.
captainzmc commented on pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#issuecomment-750810621


   Merged this. Thanks for @amaliujia's patch, and thanks for the review of @linyiqun 


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


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

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#discussion_r546174979



##########
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:
       I see.
   
   Do you know where is the place that does such failed key cleanup?




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


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

Posted by GitBox <gi...@apache.org>.
amaliujia commented on pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#issuecomment-749930343


   @captainzmc 
   
   Comments have addressed and CI has passed.


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


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

Posted by GitBox <gi...@apache.org>.
captainzmc commented on a change in pull request #1706:
URL: https://github.com/apache/ozone/pull/1706#discussion_r547148550



##########
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:
       There is a PR #1511 currently cleaning open key. I think we can use this. Update quota during cleanup.
   But this PR is not merged yet, and we do not need to block here. We can open an issue and work on it after #1511 is merged.




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