]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: use partial-order bucket listing in RGWLC
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 28 Mar 2018 21:39:33 +0000 (17:39 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Tue, 1 May 2018 16:42:48 +0000 (12:42 -0400)
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 <mbenjamin@redhat.com>
src/rgw/rgw_lc.cc

index 5aa57d384dc7f5c6d37e9c0e1dc47c307a061960..aad21561ad25e36857809e3d968259766de46ac1 100644 (file)
@@ -294,6 +294,10 @@ int RGWLC::handle_multipart_expiration(RGWRados::Bucket *target, const map<strin
   RGWBucketInfo& bucket_info = target->get_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();