Bug 1757298

Summary: [RGW]: Bucket rename creates a duplicate entry in bucket list
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Tejas <tchandra>
Component: RGWAssignee: shilpa <smanjara>
Status: CLOSED ERRATA QA Contact: Tejas <tchandra>
Severity: high Docs Contact:
Priority: high    
Version: 3.3CC: asriram, assingh, cbodley, ceph-eng-bugs, kbader, kdreyer, khartsoe, mbenjamin, sweil, tserlin, vimishra
Target Milestone: z2   
Target Release: 3.3   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: RHEL: ceph-12.2.12-80.el7cp Ubuntu: ceph_12.2.12-73redhat1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1793400 (view as bug list) Environment:
Last Closed: 2019-12-19 17:58:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1793400    

Description Tejas 2019-10-01 06:44:34 UTC
Description of problem:
   Bucket link command used to rename a tenanted bucket created a duplicate entry in the bucket list

Version-Release number of selected component (if applicable):
ceph version 12.2.12-71.el7cp

How reproducible:
Always

Steps to Reproduce:
Mentioned below

Expected results:
Duplicate entry should not be seen

Additional info:

root@magna111 ubuntu]# radosgw-admin bucket list --uid tmp --tenant tenant
[
    "buck1"
]
[root@magna111 ubuntu]# radosgw-admin bucket list --uid 'tenant$tmp'
[
    "buck1"
]
[root@magna111 ubuntu]# 
[root@magna111 ubuntu]# radosgw-admin bucket link --bucket buck1 --bucket-new-name buck2 --uid tmp --tenant tenant
[root@magna111 ubuntu]# 
[root@magna111 ubuntu]# radosgw-admin bucket list --uid tmp --tenant tenant
[
    "buck2"          <============ only 1 entry seen
]
[root@magna111 ubuntu]# radosgw-admin bucket list --uid 'tenant$tmp'
[
    "buck2"


root@magna111 ubuntu]# radosgw-admin bucket list | grep buck1
    "tenant/buck1",   <===================== old entry still present
    "ten1/buck1",
[root@magna111 ubuntu]# radosgw-admin bucket list | grep buck2
    "tenant/buck2",
    "ten1/buck2"


root@magna111 ubuntu]# radosgw-admin bucket stats --bucket tenant/buck2
{
    "bucket": "buck2",
    "zonegroup": "11bb307c-428a-4a73-b353-414a9a53115f",
    "placement_rule": "default-placement",
    "explicit_placement": {
        "data_pool": "",
        "data_extra_pool": "",
        "index_pool": ""
    },
    "id": "97a40883-088d-4bae-88d8-671075e6d94f.406050.1",
    "marker": "97a40883-088d-4bae-88d8-671075e6d94f.406050.1",
    "index_type": "Normal",
    "owner": "tenant$tmp",    <==========================  correct owner after rename
    "ver": "0#1",
    "master_ver": "0#0",
    "mtime": "2019-10-01 06:31:31.011499",
    "max_marker": "0#",
    "usage": {},
    "bucket_quota": {
        "enabled": false,
        "check_on_raw": false,
        "max_size": -1,
        "max_size_kb": 0,
        "max_objects": -1
    }
}
[root@magna111 ubuntu]# radosgw-admin bucket stats --bucket tenant/buck1
{
    "bucket": "buck1",
    "zonegroup": "11bb307c-428a-4a73-b353-414a9a53115f",
    "placement_rule": "default-placement",
    "explicit_placement": {
        "data_pool": "",
        "data_extra_pool": "",
        "index_pool": ""
    },
    "id": "97a40883-088d-4bae-88d8-671075e6d94f.406050.1",
    "marker": "97a40883-088d-4bae-88d8-671075e6d94f.406050.1",
    "index_type": "Normal",
    "owner": "tenant$tmp",   <=============================  old  entry
    "ver": "0#1",
    "master_ver": "0#0",
    "mtime": "2019-10-01 06:29:29.426309",
    "max_marker": "0#",
    "usage": {},
    "bucket_quota": {
        "enabled": false,
        "check_on_raw": false,
        "max_size": -1,
        "max_size_kb": 0,
        "max_objects": -1
    }


root@magna111 ubuntu]# s3cmd ls -c .s3tmp 
2019-10-01 06:31  s3://buck2

Comment 11 errata-xmlrpc 2019-12-19 17:58:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:4353