Project

General

Profile

Bug #36234

swift: dump_account_metadata doesn't return quota info

Added by Herve Rousseau over 5 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
% Done:

0%

Source:
Community (user)
Tags:
Backport:
luminous
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Context

  • Ceph cluster running 12.2.8
  • RadosGW with keystone integration
  • reproduced on 13.2.2 (with ceph-nano)

Steps to reproduce {
"user_id": "nano",
"display_name": "Ceph demo user",
"email": "",
"suspended": 0,
"max_buckets": 1000,
"auid": 0,
"subusers": [ {
"id": "nano:swift",
"permissions": "full-control"
}
],

[...]
  • Use the swift CLI to get account metadata:
    # swift -A http://127.0.0.1:8000/auth -U nano:swift -K xxxxxxx stat -v
    StorageURL: http://127.0.0.1:8000/swift/v1
    Auth Token: AUTH_rgwtk0a0000006e616e6f3a73776966741937a58ca32ba0e417c1ad5bc6abb61d5703f91372d75cc0333d7e8ac0785327fe30133e
    Account: v1
    Containers: 0
    Objects: 0
    Bytes: 0
    Objects in policy "default-placement-bytes": 0
    Bytes in policy "default-placement-bytes": 0
    Containers in policy "default-placement": 0
    Objects in policy "default-placement": 0
    Bytes in policy "default-placement": 0
    Accept-Ranges: bytes
    X-Timestamp: 1538027415.50384
    X-Account-Bytes-Used-Actual: 0
    X-Trans-Id: tx000000000000000000039-005bac6f97-5e2f-default
    Content-Type: text/plain; charset=utf-8
    X-Openstack-Request-Id: tx000000000000000000039-005bac6f97-5e2f-default
"user_quota": {
"enabled": true,
"check_on_raw": false,
"max_size": 10737418240,
"max_size_kb": 10485760,
"max_objects": -1
},
"temp_url_keys": [],
"type": "rgw",
"mfa_ids": []
}
@

Expected output

A little bit of fiddling with GDB seems to show that the "quota" object doesn't contain anything useful (but my skills here are rather limited)
(gdb) break rgw_rest_swift.cc:124
(gdb) cont
Continuing.
[Switching to Thread 0x7f95ca764700 (LWP 561)]

Python Exception <type 'exceptions.ValueError'> Cannot find type const std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, RGWUsageStats, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, RGWUsageStats> > >::_Rep_type:
Python Exception <class 'gdb.error'> There is no member or method named _M_value_field.:
Breakpoint 1, dump_account_metadata (s=0x7f95ca75b130, global_stats=..., policies_stats=std::map with 1 elements, attrs=std::map with 1 elements, quota=..., policy=...) at /usr/src/debug/ceph-13.2.2/src/rgw/rgw_rest_swift.cc:124
124 if (quota.enabled) {
(gdb) set print pretty on
(gdb) p quota
$1 = (const RGWQuotaInfo &) @0x55d44d2aaa80: {
max_size_soft_threshold = -1,
max_objs_soft_threshold = -1,
max_size = -1,
max_objects = -1,
enabled = false,
check_on_raw = false
}
(gdb)

History

#1 Updated by Herve Rousseau over 5 years ago

Seems like the parser doesn't like the formatting, here's the RAW version

h3. Context

 * Ceph cluster running 12.2.8
 * RadosGW with keystone integration
 * reproduced on 13.2.2 (with ceph-nano)

h3. Steps to reproduce

 * Create a swift keypair for a user
@radosgw-admin subuser create --uid=nano --subuser=nano:swift --key-type=swift@

 * Grant user-level quota and enable user quotas
@radosgw-admin quota set --uid=nano --max-size=10G --quota-scope=user
radosgw-admin quota enable --uid=nano --quota-scope=user@

 * Check that everything is properly configured
@# radosgw-admin user info --uid=nano                                                                                                                                                                                                                                                                                              
{
    "user_id": "nano",
    "display_name": "Ceph demo user",
    "email": "",
    "suspended": 0,
    "max_buckets": 1000,
    "auid": 0,
    "subusers": [
        {
            "id": "nano:swift",
            "permissions": "full-control" 
        }
    ],

 [...]

    "user_quota": {
        "enabled": true,
        "check_on_raw": false,
        "max_size": 10737418240,
        "max_size_kb": 10485760,
        "max_objects": -1
    },
    "temp_url_keys": [],
    "type": "rgw",
    "mfa_ids": []
}
@
 * Use the swift CLI to get account metadata:
@# swift -A http://127.0.0.1:8000/auth -U nano:swift -K xxxxxxx stat -v
                                 StorageURL: http://127.0.0.1:8000/swift/v1
                                 Auth Token: AUTH_rgwtk0a0000006e616e6f3a73776966741937a58ca32ba0e417c1ad5bc6abb61d5703f91372d75cc0333d7e8ac0785327fe30133e
                                    Account: v1
                                 Containers: 0
                                    Objects: 0
                                      Bytes: 0
Objects in policy "default-placement-bytes": 0
  Bytes in policy "default-placement-bytes": 0
   Containers in policy "default-placement": 0
      Objects in policy "default-placement": 0
        Bytes in policy "default-placement": 0
                              Accept-Ranges: bytes
                                X-Timestamp: 1538027415.50384
                X-Account-Bytes-Used-Actual: 0
                                 X-Trans-Id: tx000000000000000000039-005bac6f97-5e2f-default
                               Content-Type: text/plain; charset=utf-8
                     X-Openstack-Request-Id: tx000000000000000000039-005bac6f97-5e2f-default
@

h3. Expected output

 * Similar to the previous command, but with the X-Account-Meta-Quota-Bytes additional field as per https://github.com/ceph/ceph/blob/v13.2.2/src/rgw/rgw_rest_swift.cc#L123-L134

A little bit of fiddling with GDB seems to show that the "quota" object doesn't contain anything useful (but my skills here are rather limited)
(gdb) break rgw_rest_swift.cc:124
(gdb) cont
Continuing.
[Switching to Thread 0x7f95ca764700 (LWP 561)]

Python Exception <type 'exceptions.ValueError'> Cannot find type const std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, RGWUsageStats, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, RGWUsageStats> > >::_Rep_type: 
Python Exception <class 'gdb.error'> There is no member or method named _M_value_field.: 
Breakpoint 1, dump_account_metadata (s=0x7f95ca75b130, global_stats=..., policies_stats=std::map with 1 elements, attrs=std::map with 1 elements, quota=..., policy=...) at /usr/src/debug/ceph-13.2.2/src/rgw/rgw_rest_swift.cc:124
124       if (quota.enabled) {
(gdb) set print pretty on
(gdb) p quota
$1 = (const RGWQuotaInfo &) @0x55d44d2aaa80: {
  max_size_soft_threshold = -1, 
  max_objs_soft_threshold = -1, 
  max_size = -1, 
  max_objects = -1, 
  enabled = false, 
  check_on_raw = false
}
(gdb) 

#2 Updated by Casey Bodley over 5 years ago

  • Status changed from New to 12

#3 Updated by Yehuda Sadeh over 5 years ago

  • Assignee set to Marcus Watts

#4 Updated by Patrick Donnelly over 4 years ago

  • Status changed from 12 to New

Also available in: Atom PDF