Project

General

Profile

Actions

Bug #49051

open

rgw: lc can not expired null versioned object when bucket is versioning-suspend

Added by joke lee about 3 years ago. Updated about 3 years ago.

Status:
Fix Under Review
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

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

Description

use the follow script create bucket and set bucket versioning-suspend and upload file 2.txt, and then set lc expired 1 day for all files

#!/usr/bin/python
from boto3.session import Session
import boto3
import boto.s3.connection
import logging

logging.basicConfig(level=logging.DEBUG)
boto.set_stream_logger('boto')
access_key = 'yly'
secret_key = 'yly'
endpoint = 'http://127.0.0.1:8000'
session = Session(access_key, secret_key)
s3_client = session.client('s3', endpoint_url=endpoint,
config=boto3.session.Config(connect_timeout=3000000,
read_timeout=3000000,
retries={'max_attempts': 0},
signature_version="s3"))

bucketname = "testlc3"
s3_client.create_bucket(Bucket=bucketname)
s3_client.put_bucket_versioning(Bucket=bucketname,VersioningConfiguration={'Status': 'Suspended'})
s3_client.put_object(Bucket=bucketname,Key="2.txt", Body="0"*5)
s3_client.put_bucket_lifecycle(
Bucket=bucketname,
LifecycleConfiguration={
'Rules': [ {
'Expiration': {
'Days': 1,
},
'ID': 'string',
'Prefix': '',
'Status': 'Enabled',
},
]
},
)

set rgw_lc_debug_interval = 10 and run radosgw-admin lc process --include-all

in the log, it says the object 2.txt is DELETE,
2021-01-29T13:59:30.782+0800 7f880dfeb700 2 DELETED::testlc3[037fe0a6-cf27-4cfd-bd36-4611c036053a.34206.1]):2.txt wp_thrd: 0, 1

but when you list versions, the 2.txt with null version is still exist and it is not change to delete marker with null version

according to https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html

Versioning-suspended bucket

The lifecycle creates a delete marker with null version ID, which becomes the current version. If the version ID of the current version of the object is null, the Expiration action permanently deletes this version. Otherwise, the current version is retained as a noncurrent version.

Actions #2

Updated by J. Eric Ivancich about 3 years ago

  • Pull request ID set to 39156
Actions #3

Updated by Casey Bodley about 3 years ago

  • Status changed from New to Fix Under Review
  • Tags set to lifecycle
Actions

Also available in: Atom PDF