]> git-server-git.apps.pok.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)
committerNathan Cutler <ncutler@suse.com>
Thu, 30 May 2019 13:05:34 +0000 (15:05 +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 05552782f149d61e3ad75dad0ea65cc169bfce5e..d034f584a3667af8ba7a6b2742ac082480dd64ee 100644 (file)
@@ -188,6 +188,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) {
@@ -499,8 +503,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 fb30d699784a6a3a847a73c46da826e295e33026..1ef8b837b14db93181f817aa3fbee9dec2c59d20 100644 (file)
@@ -162,6 +162,7 @@ class RGWOrphanSearch {
 
   uint16_t max_concurrent_ios;
   uint64_t stale_secs;
+  uint64_t max_list_obj_entries;
 
   struct log_iter_info {
     string oid;