From: Matt Benjamin Date: Wed, 28 Mar 2018 21:39:33 +0000 (-0400) Subject: rgw: use partial-order bucket listing in RGWLC X-Git-Tag: v14.0.0~48^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=13967437469874eff0d7e5cd94da6d6ba10619b6;p=ceph.git rgw: use partial-order bucket listing in RGWLC Lifecycle processing meets the criteria for use of partial order bucket listing. Use it to improve efficiency when sharded. Fixes: http://tracker.ceph.com/issues/23956 Signed-off-by: Matt Benjamin --- diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index 5aa57d384dc7..aad21561ad25 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -294,6 +294,10 @@ int RGWLC::handle_multipart_expiration(RGWRados::Bucket *target, const mapget_bucket_info(); RGWRados::Bucket::List list_op(target); list_op.params.list_versions = false; + /* lifecycle processing does not depend on total order, so can + * take advantage of unorderd listing optimizations--such as + * operating on one shard at a time */ + list_op.params.allow_unordered = true; list_op.params.ns = RGW_OBJ_NS_MULTIPART; list_op.params.filter = &mp_filter; for (auto prefix_iter = prefix_map.begin(); prefix_iter != prefix_map.end(); ++prefix_iter) { @@ -396,7 +400,11 @@ int RGWLC::bucket_lc_process(string& shard_id) ceph_clock_now() < ceph::real_clock::to_time_t(*prefix_iter->second.expiration_date)) { continue; } + /* lifecycle processing does not depend on total order, so can + * take advantage of unorderd listing optimizations--such as + * operating on one shard at a time */ list_op.params.prefix = prefix_iter->first; + list_op.params.allow_unordered = true; do { objs.clear(); list_op.params.marker = list_op.get_next_marker();