From: Abhishek Lekshmanan Date: Wed, 13 Feb 2019 12:15:02 +0000 (+0100) Subject: rgw: orphans tool: align with rgw list bucket min readahead X-Git-Tag: v12.2.13~254^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=312562ae0aae55032a4510c09940c88799cf4999;p=ceph.git rgw: orphans tool: align with rgw list bucket min readahead 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 (cherry picked from commit 4c033bf0fd0429378ac350eecd78530cc1c11b84) --- diff --git a/src/rgw/rgw_orphan.cc b/src/rgw/rgw_orphan.cc index 05552782f149..d034f584a366 100644 --- a/src/rgw/rgw_orphan.cc +++ b/src/rgw/rgw_orphan.cc @@ -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 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; diff --git a/src/rgw/rgw_orphan.h b/src/rgw/rgw_orphan.h index fb30d699784a..1ef8b837b14d 100644 --- a/src/rgw/rgw_orphan.h +++ b/src/rgw/rgw_orphan.h @@ -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;