sodonnel opened a new pull request, #3975:
URL: https://github.com/apache/ozone/pull/3975

   ## What changes were proposed in this pull request?
   
   When updating bucket arguments from the CLI, eg:
   
   ```
   ozone sh bucket set-replication-config o3://ozone1/testquota/ec-bucket5 
--type EC --replication rs-3-2-1024k
   ```
   
   A quota related error occurs:
   
   ```
   QUOTA_ERROR Can not clear bucket spaceQuota because volume spaceQuota is not 
cleared.
   ```
   
   This is because the OMBucketArgs object defaults the quota related values to 
"-1" which means "clear the quota". As these values are "long" types, they 
cannot have a null value, so this default is always passed, making it 
impossible to know if the bucketArgs are trying to reset the quota, or just 
passed by default.
   
   This change adds a getter to OmBucketArgs called `hasQuotaInBytes` and 
`hasQuotaInNamespace` to align with the protobuf fields which tell you if a 
value has been passed or not. That way, we can tell if the values are default 
or intentionally passed.
   
   In the code that sets the bucket args, we check this before attempting to 
change the quota to avoid changing it when its just default values passed.
   
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-7346
   
   ## How was this patch tested?
   
   Unit test to reproduce the issue before the fix and confirmed the changes 
fix it.


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