Bug 1708650 - PUT Bucket Lifecycle doesn't clear existing lifecycle policy
Summary: PUT Bucket Lifecycle doesn't clear existing lifecycle policy
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: RGW
Version: 3.2
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 3.3
Assignee: Matt Benjamin (redhat)
QA Contact: RUDRA PRATAP
Aron Gunn
URL:
Whiteboard:
: 1700336 (view as bug list)
Depends On:
Blocks: 1726135
TreeView+ depends on / blocked
 
Reported: 2019-05-10 13:16 UTC by Casey Bodley
Modified: 2019-08-21 15:11 UTC (History)
12 users (show)

Fixed In Version: RHEL: ceph-12.2.12-3.el7cp Ubuntu: ceph_12.2.12-5redhat1
Doc Type: Bug Fix
Doc Text:
.A new bucket life-cycle policy will overwrite the existing life-cycle policy Because of an encoding error with the Ceph Object Gateway, storing a new bucket life-cycle policy on a bucket that already had an existing one would fail. Previously, working around the failure was done by deleting the old policy first, before storing the new one. With this release, this encoding error was fixed.
Clone Of:
Environment:
Last Closed: 2019-08-21 15:10:58 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Ceph Project Bug Tracker 39654 0 None None None 2019-05-10 13:16:38 UTC
Red Hat Product Errata RHSA-2019:2538 0 None None None 2019-08-21 15:11:09 UTC

Description Casey Bodley 2019-05-10 13:16:38 UTC
Description of problem:

Currently doing something like put LC; use a changed LC; put LC; get LC will return the first supplied LC unless there was a delete involved.


Version-Release number of selected component (if applicable):


How reproducible:

When overwriting an existing lifecycle policy


Steps to Reproduce:

1. Create two lifecycle policy files:

(aws) [abhishekl@d18:~/spells/pyspells/s3]$
cat abortmp.json
{ "Rules": [
            {
                "AbortIncompleteMultipartUpload" : {
                    "DaysAfterInitiation": 7
                },
                "ID": "Expire v1 objects",
                "Prefix": "",
                "Status": "Enabled" 
            }
]
}
(aws) [abhishekl@d18:~/spells/pyspells/s3]$
cat transition.json
{ "Rules": [
            {
                "Transition" : {
                    "Days": 10,
                    "StorageClass": "rrs" 
                },
                "Expiration" : {
                    "Days": 20
                },
                "ID": "Transition abc objects",
                "Status": "Enabled",
                "Prefix":"abc" 
            },
            {
                "Expiration" : {
                    "Days": 10
                },
                "ID": "Expire bcd objects",
                "Status": "Enabled",
                "Prefix":"bcd" 
            }
]
}

2. Create a bucket and apply the first lifecycle policy:

(aws) [abhishekl@d18:~/spells/pyspells/s3]$
aws s3api create-bucket --bucket test --endpoint=http://localhost:8000
(aws) [abhishekl@d18:~/spells/pyspells/s3]$
aws s3api put-bucket-lifecycle --bucket test --lifecycle-configuration file://transition.json
(aws) [abhishekl@d18:~/spells/pyspells/s3]$
aws s3api get-bucket-lifecycle --bucket test
{
    "Rules": [
        {
            "Status": "Enabled",
            "Prefix": "bcd",
            "Expiration": {
                "Days": 10
            },
            "ID": "Expire bcd objects" 
        },
        {
            "Status": "Enabled",
            "Prefix": "abc",
            "Transition": {
                "Days": 10,
                "StorageClass": "rrs" 
            },
            "Expiration": {
                "Days": 20
            },
            "ID": "Transition abc objects" 
        }
    ]
}

3. Apply the second lifecycle policy:

(aws) [abhishekl@d18:~/spells/pyspells/s3]$
aws s3api put-bucket-lifecycle --bucket test --lifecycle-configuration file://abortmp.json

4. Fetch the lifecycle policy:

(aws) [abhishekl@d18:~/spells/pyspells/s3]$
aws s3api get-bucket-lifecycle --bucket test
{
    "Rules": [
        {
            "Status": "Enabled",
            "Prefix": "bcd",
            "Expiration": {
                "Days": 10
            },
            "ID": "Expire bcd objects" 
        },
        {
            "Status": "Enabled",
            "Prefix": "abc",
            "Transition": {
                "Days": 10,
                "StorageClass": "rrs" 
            },
            "Expiration": {
                "Days": 20
            },
            "ID": "Transition abc objects" 
        }
    ]
}

Actual results:

Fetched policy corresponds to the first lifecycle policy.

Expected results:

Fetched policy corresponds to the second lifecycle policy.

Additional info:

Comment 2 Matt Benjamin (redhat) 2019-05-10 14:41:11 UTC
*** Bug 1700336 has been marked as a duplicate of this bug. ***

Comment 8 RUDRA PRATAP 2019-08-08 10:54:29 UTC
Lifecycle modification is working.

Rudra

Comment 10 errata-xmlrpc 2019-08-21 15:10:58 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:2538


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