Bug 2232548 - Radosgw-admin bucket stats doesn't update for bucket quota
Summary: Radosgw-admin bucket stats doesn't update for bucket quota
Keywords:
Status: NEW
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: RGW
Version: 5.3
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 7.1
Assignee: Matt Benjamin (redhat)
QA Contact: Madhavi Kasturi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-17 10:24 UTC by Shreyansh Sancheti
Modified: 2023-08-17 10:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHCEPH-7225 0 None None None 2023-08-17 10:25:11 UTC

Description Shreyansh Sancheti 2023-08-17 10:24:44 UTC
Description of problem:
After creating a test bucket in a vstart environment, I checked the bucket quota with bucket stats command. After the seeing the default I changed the bucket quota with the command line radosgw-admin tool and enabled the bucket quota, upon checking with the same command line tool and listing the bucket quota it was not updated, but when checked the same with curl on the usage api endpoint we see the quota updated.


Steps to Reproduce:
1. In a vstart cluster with the 5.3-rhel patches build, create a test bucket using awscli or s3cmd. 
2. using cmd line option update the quota for bucket 

./bin/radosgw-admin quota set --uid=testid --quota-scope=bucket --max-objects=123  --max-size=12345
#enable the bucket quota for the same bucket
./bin/radosgw-admin quota enable --quota-scope=bucket --uid=testid

#to see the changes 
./bin/radosgw-admin bucket stats --bucket=bucket1 | jq '.bucket_quota'
>>{
  "enabled": false,
  "check_on_raw": false,
  "max_size": -1,
  "max_size_kb": 0,
  "max_objects": -1
}

3. to see the changes using curl:

resource="/bucket1/"
S3KEY="**"
S3SECRET="**"
dateValue=$(date -R -u)

stringToSign="HEAD\n\n\n${dateValue}\n${resource}"

signature=`echo -en ${stringToSign} | openssl sha1 -hmac ${S3SECRET} -binary | base64`

curl -sk -H "authorization: AWS ${S3KEY}:${signature}" -H "date: ${dateValue}" "http:///${endpoint}${resource}?usage" -v -XHEAD
>
< HTTP/1.1 200 OK
< X-RGW-Object-Count: 0
< X-RGW-Bytes-Used: 0
< X-RGW-Quota-User-Size: -1
< X-RGW-Quota-User-Objects: -1
< X-RGW-Quota-Max-Buckets: 1000
< X-RGW-Quota-Bucket-Size: 13312
< X-RGW-Quota-Bucket-Objects: 123

Actual results:
>>{
  "enabled": false,
  "check_on_raw": false,
  "max_size": -1,
  "max_size_kb": 0,
  "max_objects": -1
}

Expected results:
>>{
  "enabled": true,
  "check_on_raw": false,
  "max_size": 13312,
  "max_size_kb": 0,
  "max_objects": 123
}

Additional info:

Comment 1 RHEL Program Management 2023-08-17 10:24:55 UTC
Please specify the severity of this bug. Severity is defined here:
https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity.


Note You need to log in before you can comment on or make changes to this bug.