]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: orphans tool: align with rgw list bucket min readahead
authorAbhishek Lekshmanan <abhishek@suse.com>
Wed, 13 Feb 2019 12:15:02 +0000 (13:15 +0100)
committerAbhishek Lekshmanan <abhishek@suse.com>
Fri, 12 Apr 2019 16:12:31 +0000 (18:12 +0200)
At rgw::rados layer we read upto `min readahead` entries anyway and then pass on
only the requested amount to the caller. Since this translates down to a cls
call requesting a 1000 omap keys by default, it makes sense not to waste the
entries, and process them

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit 4c033bf0fd0429378ac350eecd78530cc1c11b84)

src/rgw/rgw_orphan.cc
src/rgw/rgw_orphan.h

index 930bbb04895865963df4bafc8d78c1b4fbb2d30b..e3f3164112350f2b7422518b029345233ee1d2a1 100644 (file)
@@ -191,6 +191,10 @@ int RGWOrphanSearch::init(const string& job_name, RGWOrphanSearchInfo *info) {
     return r;
   }
 
+  constexpr auto MAX_LIST_OBJS_ENTRIES = 100;
+  max_list_bucket_entries = std::max(store->ctx()->_conf->rgw_list_bucket_min_readahead,
+                                     MAX_LIST_OBJS_ENTRIES)
+
   RGWOrphanSearchState state;
   r = orphan_store.read_job(job_name, state);
   if (r < 0 && r != -ENOENT) {
@@ -503,8 +507,8 @@ int RGWOrphanSearch::build_linked_oids_for_bucket(const string& bucket_instance_
   do {
     vector<rgw_bucket_dir_entry> result;
 
-#define MAX_LIST_OBJS_ENTRIES 100
-    ret = list_op.list_objects(MAX_LIST_OBJS_ENTRIES, &result, NULL, &truncated);
+    ret = list_op.list_objects(max_list_bucket_entries,
+                               &result, nullptr, &truncated);
     if (ret < 0) {
       cerr << "ERROR: store->list_objects(): " << cpp_strerror(-ret) << std::endl;
       return -ret;
index d8076faec9a0d3c5d04307ed42eb463b81fc765f..d7fbdfa62958be8255f58df67a20372dbd630aaf 100644 (file)
@@ -163,6 +163,7 @@ class RGWOrphanSearch {
 
   uint16_t max_concurrent_ios;
   uint64_t stale_secs;
+  uint64_t max_list_obj_entries;
 
   struct log_iter_info {
     string oid;