Repository navigation
tentacle: rgw: read user usage log in S3 GetUsage - #71100
Conversation
GET /?usage is a service-level request with no bucket in the URL, so s->bucket is null and the usage log was never read. Entries and per-category ops in the response were therefore always empty even when usage logging was enabled. Read usage from the authenticated user instead, matching RGWUsage::show() behavior. Signed-off-by: ramin.najarbashi <[email protected]> (cherry picked from commit 28928ec)
Extend radosgw-admin QA to call GET /?usage after usage data is flushed and verify CapacityUsed, Entries, and non-zero Ops. This guards the fix that reads usage from the authenticated user when no bucket is present in the service-level request. Signed-off-by: ramin.najarbashi <[email protected]> (cherry picked from commit c8797c7)
s3_get_usage() used a broken SigV4 URL (?usage in path, empty region), which returned 403 in teuthology. Sign GET / with usage query param and default region us-east-1. Extend usage-s3-getusage to verify Entries owner, Summary ops/bytes, and cross-check against usage show. Add unit tests for XML parsing helpers. RGW returns nested XML (Entries, categories, CapacityUsed) that botocore could not parse into User/Bucket/Ops fields. Add wrapper shapes, flattened lists, resultWrapper Usage, and GetUsageStatsRequest. Set region_name in get_usage_stats.py example for correct SigV4 signing. Document usage logging requirement, start-date/end-date parameters, and Entries/CapacityUsed response fields alongside existing Summary stats. Signed-off-by: ramin.najarbashi <[email protected]> (cherry picked from commit 21b4956)
Restore the previous formatting of service-2.sdk-extras.json and keep only the GetUsageStats schema additions needed for the example client, per review feedback. Signed-off-by: ramin.najarbashi <[email protected]> (cherry picked from commit e430c78)
Apply AliMasarweh's review nits so the GetUsageStats entries in service-2.sdk-extras.json use the same compact key spacing as the surrounding operations and shapes. Signed-off-by: ramin.najarbashi <[email protected]> (cherry picked from commit f4fb1e0)
Apply the same compact key spacing to the rest of the GetUsageStats / UsageStats schema shapes introduced in this series, so they match the surrounding entries and the earlier formatting nits. Signed-off-by: ramin.najarbashi <[email protected]> (cherry picked from commit 3ff9d3f)
Use the compact one-line member form AliMasarweh suggested for UsageStatsSummary in service-2.sdk-extras.json. Signed-off-by: ramin.najarbashi <[email protected]> (cherry picked from commit 21b8f19)
Collapse single-member shapes onto one line and align inner spacing for all GetUsageStats/UsageStats* definitions added by this PR in examples/rgw/boto3/service-2.sdk-extras.json, matching the compact style requested in review. Signed-off-by: ramin.najarbashi <[email protected]> (cherry picked from commit a3523b1)
|
Thank you for your contribution. Since you are not yet a member of the Ceph organization with write permissions on ceph/ceph.git, our CI will not automatically run. Any member of the Ceph organization may label this PR |
|
Hi — Releng Audit is currently failing on Missing Backport Tracker for The Backport ticket already exists as #79541 (Ceph Release= Could someone with Redmine relation permissions please add: …and then comment |
|
Ping for review, please. This is the tentacle backport of merged #69459 (tracker #79541). @ceph/rgw could someone take a look and, if you are a Ceph org member, add Releng Audit is still Missing Backport Tracker because I cannot create the |
|
ok to test |
|
pr testing completed and approved by @ivancich , more details in : https://tracker.ceph.com/issues/80189. |
Summary
Backport of #69459 to tentacle.
S3 GetUsage did not return per-user usage log entries that radosgw-admin usage show returns for the same user.
Why tentacle: the same issue/feature gap exists on tentacle; operators on this release need the fix landed on main.
Minimal change: cherry-pick of all commits from PR #69459 with
git cherry-pick -x.No manual conflict resolution was required.
Parent tracker: https://tracker.ceph.com/issues/79539
Official backport tracker: https://tracker.ceph.com/issues/79673
Testing
ninja bin/radosgw-admincompleted successfully after repairingsrc/isa-lto the branch submodule SHAChecklist
Fixes: https://tracker.ceph.com/issues/79541