Project

General

Profile

Bug #39654

rgw: Put LC doesn't clear existing lifecycle

Added by Abhishek Lekshmanan 4 months ago. Updated 24 days ago.

Status:
Resolved
Priority:
High
Target version:
-
Start date:
05/09/2019
Due date:
% Done:

0%

Source:
Tags:
Backport:
nautilus
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

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.

(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" 
            }
]
}
(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" 
        }
    ]
}
(aws) [abhishekl@d18:~/spells/pyspells/s3]$
aws s3api put-bucket-lifecycle --bucket test --lifecycle-configuration file://abortmp.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" 
        }
    ]
}


Related issues

Copied to rgw - Backport #40512: nautilus: rgw: Put LC doesn't clear existing lifecycle Resolved

History

#1 Updated by Abhishek Lekshmanan 4 months ago

  • Assignee set to Abhishek Lekshmanan
  • Priority changed from Normal to High

#2 Updated by Casey Bodley 4 months ago

#3 Updated by Casey Bodley 4 months ago

Don't we need this fix on mimic/luminous?

#4 Updated by Abhishek Lekshmanan 4 months ago

Actually this came up as a part of hte nautilus refactor of LC code, the previous code was actually in rgw_op https://github.com/ceph/ceph/commit/36a1895d8fa7a94a7f12f509d9300f8d1f080c4a

This will affect https://github.com/ceph/ceph/pull/27966

#5 Updated by Matt Benjamin 4 months ago

Thanks, I'll add it to the backport.

Matt

#6 Updated by Casey Bodley 4 months ago

  • Pull request ID set to 28049

#7 Updated by Casey Bodley 3 months ago

  • Status changed from New to Testing

#8 Updated by Casey Bodley 3 months ago

  • Status changed from Testing to Pending Backport

#9 Updated by Nathan Cutler 3 months ago

  • Copied to Backport #40512: nautilus: rgw: Put LC doesn't clear existing lifecycle added

#10 Updated by Nathan Cutler 24 days ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF