]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add lifecycle thread delay 21755/head
authorMatt Benjamin <mbenjamin@redhat.com>
Tue, 1 May 2018 16:41:45 +0000 (12:41 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Tue, 1 May 2018 17:23:47 +0000 (13:23 -0400)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/common/options.cc
src/rgw/rgw_lc.cc

index e7f5eac92bff2ce9995c35324efd866edc0319c8..248001daaa0367a378b61ad90588031725de8a76 100644 (file)
@@ -5028,6 +5028,10 @@ std::vector<Option> get_rgw_options() {
     .set_default(60)
     .set_description(""),
 
+    Option("rgw_lc_thread_delay", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    .set_default(0)
+    .set_description("Delay after processing of bucket listing chunks (i.e., per 1000 entries) in milliseconds"),
+
     Option("rgw_lc_max_objs", Option::TYPE_INT, Option::LEVEL_ADVANCED)
     .set_default(32)
     .set_description("Number of lifecycle data shards")
index aad21561ad25e36857809e3d968259766de46ac1..bd36d49e350f9444926d193698f853e12102c4e6 100644 (file)
@@ -293,6 +293,7 @@ int RGWLC::handle_multipart_expiration(RGWRados::Bucket *target, const map<strin
   int ret;
   RGWBucketInfo& bucket_info = target->get_bucket_info();
   RGWRados::Bucket::List list_op(target);
+  auto delay_ms = cct->_conf->get_val<int64_t>("rgw_lc_thread_delay");
   list_op.params.list_versions = false;
   /* lifecycle processing does not depend on total order, so can
    * take advantage of unorderd listing optimizations--such as
@@ -332,7 +333,8 @@ int RGWLC::handle_multipart_expiration(RGWRados::Bucket *target, const map<strin
           if (going_down())
             return 0;
         }
-      }
+      } /* for objs */
+      std::this_thread::sleep_for(std::chrono::milliseconds(delay_ms));
     } while(is_truncated);
   }
   return 0;
@@ -357,6 +359,7 @@ int RGWLC::bucket_lc_process(string& shard_id)
   vector<rgw_bucket_dir_entry> objs;
   RGWObjectCtx obj_ctx(store);
   vector<std::string> result;
+  auto delay_ms = cct->_conf->get_val<int64_t>("rgw_lc_thread_delay");
   boost::split(result, shard_id, boost::is_any_of(":"));
   string bucket_tenant = result[0];
   string bucket_name = result[1];
@@ -478,7 +481,8 @@ int RGWLC::bucket_lc_process(string& shard_id)
             if (going_down())
               return 0;
           }
-        }
+        } /* for objs */
+       std::this_thread::sleep_for(std::chrono::milliseconds(delay_ms));
       } while (is_truncated);
     }
   } else {