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: v14.2.1~30^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c003e5f33b1ddb72e040e7bfbb37cb89b583e507;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 930bbb04895..e3f31641123 100644 --- a/src/rgw/rgw_orphan.cc +++ b/src/rgw/rgw_orphan.cc @@ -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 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 d8076faec9a..d7fbdfa6295 100644 --- a/src/rgw/rgw_orphan.h +++ b/src/rgw/rgw_orphan.h @@ -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;