Project

General

Profile

Actions

Bug #38486

closed

rgw: abort multipart in lifecycle when enable index shard

Added by J. Eric Ivancich about 5 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Target version:
% Done:

0%

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

Description

The multipart lifecycle rule is not able to clean up all entries because it skips over some bucket index shards.


Related issues 2 (0 open2 closed)

Copied to rgw - Backport #38711: mimic: rgw: abort multipart in lifecycle when enable index shardRejectedActions
Copied to rgw - Backport #38712: luminous: rgw: abort multipart in lifecycle when enable index shardRejectedActions
Actions #1

Updated by J. Eric Ivancich about 5 years ago

This issue was originally identified in a PR by yuliyang <> (github user joke-lee). The solution proposed in the PR was too specific, and a more general solution is preferable. See:

https://github.com/ceph/ceph/pull/26480
Actions #2

Updated by J. Eric Ivancich about 5 years ago

Reproduction steps as described by yulilang:

rgw_override_bucket_index_max_shards = 128
rgw_enable_lc_threads = false
rgw_lifecycle_work_time = "00:00-24:00"
rgw lc debug interval = 1

we set shard num 128

#!/usr/bin/env python
# -*- coding:utf-8 -*-
from boto3.session import Session
import boto3
access_key = "user1" 
secret_key = "user1" 
session = Session(access_key, secret_key)
url = "http://127.0.0.1" 
config_dict = { 'signature_version' : 's3', 'connect_timeout': 30000, 'read_timeout': 30000}
config = boto3.session.Config(**config_dict)
s3_client = session.client('s3', endpoint_url=url, config=config)
bucket = "test1" 
key = "异形契约.mp4" 
mpu = s3_client.create_multipart_upload(Bucket=bucket, Key=key)

and get which shard the obj store in

for i in `./bin/rados -p default.rgw.buckets.index ls -c ceph.conf`; do echo $i "\t start";./bin/rados -p default.rgw.buckets.index listomapkeys $i -c ceph.conf; echo "\t end";done

...
.dir.96e298ca-3b00-4aff-8faf-c13d35e14925.14133.1.39
_multipart_异形契约.mp4.2~7Be__tcdECK1K_OpIfYr645lzGoCxAZ.meta
...

the obj in shard 39

set the lc rule

from boto3.session import Session
import boto3
access_key = "user1" 
secret_key = "user1" 
session = Session(access_key, secret_key)
url = "http://127.0.0.1" 
config_dict = { 'signature_version' : 's3', 'connect_timeout': 30000, 'read_timeout': 30000}
config = boto3.session.Config(**config_dict)
s3_client = session.client('s3', endpoint_url=url, config=config)
s3_client.put_bucket_lifecycle(Bucket='test1', LifecycleConfiguration={
'Rules': [
{
    'ID': 'test',
    'Prefix': '',
    'Status': 'Enabled',
    'AbortIncompleteMultipartUpload': {
                    'DaysAfterInitiation': 1
                },
    'Expiration': {
                    'ExpiredObjectDeleteMarker': True
                }

},
]
}
)

and the abort will never execute

  uint32_t current_shard;
  if (shard_id >= 0) {
    current_shard = shard_id;
  } else if (my_start.empty()) {
    current_shard = 0u;
  } else {
    current_shard =
      rgw_bucket_shard_index(my_start.name, num_shards);  <== the old code go here and get the  current_shard value 101, so the obj in 101-128 shard will execute abort but the obj in shard 39 will  never execute,
  }
Actions #3

Updated by J. Eric Ivancich about 5 years ago

  • Pull request ID set to 26658
Actions #4

Updated by J. Eric Ivancich about 5 years ago

  • Status changed from In Progress to Fix Under Review
Actions #5

Updated by J. Eric Ivancich about 5 years ago

  • Status changed from Fix Under Review to Pending Backport
Actions #6

Updated by Nathan Cutler about 5 years ago

  • Copied to Backport #38711: mimic: rgw: abort multipart in lifecycle when enable index shard added
Actions #7

Updated by Nathan Cutler about 5 years ago

  • Copied to Backport #38712: luminous: rgw: abort multipart in lifecycle when enable index shard added
Actions #8

Updated by Nathan Cutler almost 5 years ago

  • Project changed from Ceph to rgw
Actions #9

Updated by J. Eric Ivancich over 3 years ago

  • Status changed from Pending Backport to Resolved
Actions

Also available in: Atom PDF