Bug #68211
closedWrong x-rgw-quota-bucket-objects header when bucket quota is disabled
100%
Description
In Ceph 18.2.4, the X-RGW-Quota-Bucket-Objects header always contains the
quota value of the actual bucket, even if the quota is not enabled per-bucket, but
per-user.
Here's a bucket with a per-user quota:
$ radosgw-admin user info --uid $uid | jq .bucket_quota
{
"enabled": true,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": 0,
"max_objects": 10000000
}
$ radosgw-admin bucket stats --bucket $bucket | jq .bucket_quota
{
"enabled": false,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": 0,
"max_objects": -1
}
# Using a recent curl release (e.g. 8.7+)
$ curl $objects_url/$bucket --request HEAD --user $access_key:$secret_key --aws-sigv4 "aws:amz:us-east-1:s3" -v 2>&1 | grep bucket-object
< x-rgw-quota-bucket-objects: -1
Changing the bucket quota, even though it is not enabled, causes the header to be set ot the given quota:
radosgw-admin quota set --quota-scope=bucket --max-objects=100 --bucket $bucket
$ radosgw-admin bucket stats --bucket $bucket | jq .bucket_quota
{
"enabled": false,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": 0,
"max_objects": 100
}
$ curl $objects_url/$bucket --request HEAD --user $access_key:$secret_key --aws-sigv4 "aws:amz:us-east-1:s3" -v 2>&1 | grep bucket-object
< x-rgw-quota-bucket-objects: 100
Note that the per-bucket quota did not have to be enabled for the value to change.
I'm not sure how this is designed to work, but I naively expected these headers to reflect the quota that's actually applied.
DG Updated by Daniel Gryniewicz about 2 years ago
- Tags set to low-hanging-fruit
The headers we return for this are:
X-RGW-Quota-User-Size, X-RGW-Quota-User-Objects, X-RGW-Quota-Max-Buckets, X-RGW-Quota-Bucket-Size, X-RGW-Quota-Bucket-Objects
So we are including the user quota. There's no indication of whether or not each quota is enabled. So one possible fix is to include enabled status, another is to only include each quota if it's enabled.
RS Updated by Raja Sharma about 2 years ago
- Status changed from New to In Progress
- Assignee set to Raja Sharma
- % Done changed from 0 to 50
- Pull request ID set to 60551
RS Updated by Raja Sharma about 2 years ago
- Status changed from In Progress to Fix Under Review
RS Updated by Raja Sharma about 2 years ago
- Pull request ID changed from 60551 to 60756
CB Updated by Casey Bodley about 2 years ago
- Status changed from Fix Under Review to Pending Backport
- Backport set to reef squid
UB Updated by Upkeep Bot about 2 years ago
- Copied to Backport #69047: reef: Wrong x-rgw-quota-bucket-objects header when bucket quota is disabled added
UB Updated by Upkeep Bot about 2 years ago
- Copied to Backport #69048: squid: Wrong x-rgw-quota-bucket-objects header when bucket quota is disabled added
UB Updated by Upkeep Bot about 2 years ago
- Tags (freeform) set to backport_processed
RS Updated by Raja Sharma almost 2 years ago
- Status changed from Pending Backport to Resolved
- % Done changed from 50 to 100
UB Updated by Upkeep Bot over 1 year ago
- Merge Commit set to 236002230ab5107bf48c51c75392f57844ddef39
- Fixed In set to v19.3.0-6184-g236002230ab
- Upkeep Timestamp set to 2025-07-10T11:37:49+00:00
UB Updated by Upkeep Bot over 1 year ago
- Fixed In changed from v19.3.0-6184-g236002230ab to v19.3.0-6184-g236002230a
- Upkeep Timestamp changed from 2025-07-10T11:37:49+00:00 to 2025-07-14T20:10:23+00:00
UB Updated by Upkeep Bot about 1 year ago
- Released In set to v20.2.0~1592
- Upkeep Timestamp changed from 2025-07-14T20:10:23+00:00 to 2025-11-01T01:30:32+00:00
UB Updated by Upkeep Bot 3 months ago
- Tags (freeform) deleted (
backport_processed) - Upkeep Timestamp changed from 2025-11-01T01:30:32+00:00 to 2026-08-28T01:37:32+00:00