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/19 10:58:21 UTC

[GitHub] [ozone] linyiqun commented on a change in pull request #1723: HDDS-4588. If volume's quota is enabled then bucket's quota cannot be cleared

linyiqun commented on a change in pull request #1723:
URL: https://github.com/apache/ozone/pull/1723#discussion_r546224631



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketSetPropertyRequest.java
##########
@@ -259,9 +266,16 @@ public boolean checkQuotaBytesValid(OMMetadataManager metadataManager,
   }
 
   public boolean checkQuotaNamespaceValid(OmVolumeArgs omVolumeArgs,
-      OmBucketArgs omBucketArgs) {
+      OmBucketArgs omBucketArgs) throws IOException{
     long quotaInNamespace = omBucketArgs.getQuotaInNamespace();
 
+    if (quotaInNamespace == OzoneConsts.QUOTA_RESET &&
+        omVolumeArgs.getQuotaInNamespace() != OzoneConsts.QUOTA_RESET) {
+      throw new OMException("Before clear bucket " +
+          "quotaInNamespace, volume quotaInNamespace need to be clear first.",

Review comment:
       Agreed with @amaliujia 's suggestion. I also prefer to do below rename changing for more readable:
   
   quotaInNamespace -> namespaceQuota
   quotaInNamespace -> spaceQuota
   




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