Project

General

Profile

Actions

Bug #68211

closed

Wrong x-rgw-quota-bucket-objects header when bucket quota is disabled

Added by Denis Krienbühl over 1 year ago. Updated 6 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
% Done:

100%

Source:
Community (user)
Backport:
reef squid
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
backport_processed
Fixed In:
v19.3.0-6184-g236002230a
Released In:
v20.2.0~1592
Upkeep Timestamp:
2025-11-01T01:30:32+00:00

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.


Related issues 2 (2 open0 closed)

Copied to rgw - Backport #69047: reef: Wrong x-rgw-quota-bucket-objects header when bucket quota is disabledNewRaja SharmaActions
Copied to rgw - Backport #69048: squid: Wrong x-rgw-quota-bucket-objects header when bucket quota is disabledNewRaja SharmaActions
Actions #1

Updated by Daniel Gryniewicz over 1 year 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.

Actions #2

Updated by Raja Sharma over 1 year 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
Actions #3

Updated by Raja Sharma over 1 year ago

  • Status changed from In Progress to Fix Under Review
Actions #4

Updated by Raja Sharma over 1 year ago

  • Pull request ID changed from 60551 to 60756
Actions #5

Updated by Casey Bodley over 1 year ago

  • Status changed from Fix Under Review to Pending Backport
  • Backport set to reef squid
Actions #6

Updated by Upkeep Bot over 1 year ago

  • Copied to Backport #69047: reef: Wrong x-rgw-quota-bucket-objects header when bucket quota is disabled added
Actions #7

Updated by Upkeep Bot over 1 year ago

  • Copied to Backport #69048: squid: Wrong x-rgw-quota-bucket-objects header when bucket quota is disabled added
Actions #8

Updated by Upkeep Bot over 1 year ago

  • Tags (freeform) set to backport_processed
Actions #9

Updated by Raja Sharma over 1 year ago

  • Status changed from Pending Backport to Resolved
  • % Done changed from 50 to 100
Actions #10

Updated by Upkeep Bot 10 months 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
Actions #11

Updated by Upkeep Bot 10 months 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
Actions #12

Updated by Upkeep Bot 6 months 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
Actions

Also available in: Atom PDF