Noobaa/Quota: Provide correct error message #8668
Open
+7
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we exceed the object quota for a bucket,
we should provide an error message which can
convey the clear problem.
https://issues.redhat.com/browse/DFBUGS-242
Testing -
1 - Create noobaa bucket
nb bucket create test.bucket
2 - Set object quota on test.bucket
nb bucket update test.bucket --max-objects=1
3 - Copy one object on this bucket
s3 cp ../test.file s3://test.bucket
4 - Check status of bucket -
date; nb bucket status test.bucket
You might see that everything is fine. At this point you can upload more object but there will not be any issue.
It is because the number of objects has not been update on database.
Keep checking the status. After 2 minutes or so, you will see following status -
Bucket status:
Bucket : test.bucket
Type : REGULAR
Mode : EXCEEDING_QUOTA
ResiliencyStatus : OPTIMAL
QuotaStatus : EXCEEDING_QUOTA
Num Objects : 1
Data Size : 32.620 KB
Data Size Reduced : 11.995 KB
Data Space Avail : 6.243 GB
Num Objects Avail : 0
After this any more object upload will fail.
s3 cp ../system.go s3://test.bucket
You will see following error message -
upload failed: ../test.file to s3://test.bucket/test.file An error occurred (ObjectQuotaExceeded) when calling the PutObject operation: Object quota exceeded for the bucket.