Project

General

Profile

Bug #57936

'radosgw-admin bucket chown' doesn't set bucket instance owner or unlink from old owner

Added by Casey Bodley 3 months ago. Updated 11 days ago.

Status:
Pending Backport
Priority:
Normal
Target version:
-
% Done:

0%

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

Description

steps to reproduce:

1. start a vstart cluster and create a bucket as user 'testid'

~/ceph/build $ MON=1 OSD=1 RGW=1 MGR=0 MDS=0 ../src/vstart.sh -n -d
~/ceph/build $ bin/radosgw-admin user list
[
    "56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234",
    "testx$9876543210abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
    "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
    "test",
    "testid" 
]
~/ceph/build $ s3cmd mb s3://testbucket
Bucket 's3://testbucket/' created
~/ceph/build $ bin/radosgw-admin metadata list bucket.instance
[
    "testbucket:5c06055b-ce0d-4829-8d66-4fec8a3b69cf.4147.1" 
]
~/ceph/build $ bin/radosgw-admin metadata get bucket.instance:testbucket:5c06055b-ce0d-4829-8d66-4fec8a3b69cf.4147.1 | grep owner
            "owner": "testid",
~/ceph/build $ bin/radosgw-admin metadata get bucket:testbucket | grep owner
        "owner": "testid",

2. change bucket owner to user 'test'. the bucket instance's owner is still 'testid', and the bucket is now linked to both users

~/ceph/build $ bin/radosgw-admin bucket chown --bucket testbucket --uid test
0 objects processed in :testbucket[5c06055b-ce0d-4829-8d66-4fec8a3b69cf.4147.1]). Next marker

~/ceph/build $ bin/radosgw-admin metadata get bucket.instance:testbucket:5c06055b-ce0d-4829-8d66-4fec8a3b69cf.4147.1 | grep owner
            "owner": "testid",
~/ceph/build $ bin/radosgw-admin metadata get bucket:testbucket | grep owner
        "owner": "test",
~/ceph/build $ bin/radosgw-admin bucket list --uid testid
[
    "testbucket" 
]
~/ceph/build $ bin/radosgw-admin bucket list --uid test
[
    "testbucket" 
]

3. upload a single 128MB object to the bucket. the new object is counted against the 'user stats' of both users

~/ceph/build $ s3cmd put 128m.iso s3://testbucket
...
upload: '128m.iso' -> 's3://testbucket/128m.iso'  [part 9 of 9, 8MB] [1 of 1]
 8388608 of 8388608   100% in    0s   127.21 MB/s  done

~/ceph/build $ bin/radosgw-admin user stats --uid testid --sync-stats
{
    "stats": {
        "size": 134217728,                                                                                                                                    
        "size_actual": 134217728,                                                                                                                             
        "size_kb": 131072,                                                                                                                                    
        "size_kb_actual": 131072,                                                                                                                             
        "num_objects": 1
    },
    "last_stats_sync": "2022-10-26T21:37:56.577699Z",
    "last_stats_update": "2022-10-26T21:37:56.576376Z" 
}
~/ceph/build $ bin/radosgw-admin user stats --uid test --sync-stats
{
    "stats": {
        "size": 134217728,                                                                                                                                    
        "size_actual": 134217728,                                                                                                                             
        "size_kb": 131072,                                                                                                                                    
        "size_kb_actual": 131072,                                                                                                                             
        "num_objects": 1
    },
    "last_stats_sync": "2022-10-26T21:38:00.272976Z",
    "last_stats_update": "2022-10-26T21:38:00.271206Z" 
}

this behavior was last changed in https://github.com/ceph/ceph/pull/41108


Related issues

Copied to rgw - Backport #58509: quincy: 'radosgw-admin bucket chown' doesn't set bucket instance owner or unlink from old owner In Progress

History

#1 Updated by Casey Bodley 3 months ago

  • Status changed from New to In Progress
  • Assignee set to Daniel Gryniewicz

#2 Updated by Daniel Gryniewicz 3 months ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 48730

#3 Updated by Casey Bodley 11 days ago

  • Status changed from Fix Under Review to Resolved

#4 Updated by Casey Bodley 11 days ago

  • Status changed from Resolved to Pending Backport

#5 Updated by Backport Bot 11 days ago

  • Copied to Backport #58509: quincy: 'radosgw-admin bucket chown' doesn't set bucket instance owner or unlink from old owner added

#6 Updated by Backport Bot 11 days ago

  • Tags changed from chown to chown backport_processed

Also available in: Atom PDF