captainzmc opened a new pull request #1746:
URL: https://github.com/apache/ozone/pull/1746
## What changes were proposed in this pull request?
Currently setting Quota is invalid if set to 0. It's actually going to be
set to -1.
`store.getVolume(volumeName).getBucket(bucketName).setQuota(`
` OzoneQuota.parseQuota("0GB", 0));`
` Assert.assertEquals(-1, bucket.getQuotaInBytes());`
` Assert.assertEquals(-1, bucket.getQuotaInNamespace());`
This behavior is actually incorrect, and we should actually support quota
setting to 0:
`store.getVolume(volumeName).getBucket(bucketName).setQuota(`
` OzoneQuota.parseQuota("0GB", 0));`
` Assert.assertEquals(0, bucket.getQuotaInBytes());`
` Assert.assertEquals(0, bucket.getQuotaInNamespace());`
This problem occurs because the original client quota type is long. If the
user does not specify quota, the default value for this field is 0.
A backend validation fails to verify that the user did not specify quota or
set quoat to 0, since both actions are passed to the backend to be 0.
So it would be more appropriate to change the long to a string. If the user
does not specify quota, it is null. It's easier to judge.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-4631
## How was this patch tested?
ut added
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]