]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: introduce rgw_list_bucket_min_readahead parameter for bucket listing from rados 8756/head
authorAbhishek Varshney <abhishek.varshney@flipkart.com>
Tue, 26 Apr 2016 08:54:29 +0000 (14:24 +0530)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Tue, 26 Apr 2016 08:54:29 +0000 (14:24 +0530)
Signed-off-by: Abhishek Varshney <abhishek.varshney@flipkart.com>
src/common/config_opts.h
src/rgw/rgw_rados.cc

index 786d9e00d8e8d55b929666174af4e7c9129c4d96..bdb8d88b8fa25a72f510713e72c8acc6cdc686c5 100644 (file)
@@ -1405,6 +1405,8 @@ OPTION(rgw_period_push_interval_max, OPT_DOUBLE, 30) // maximum interval after e
 
 OPTION(rgw_swift_versioning_enabled, OPT_BOOL, false) // whether swift object versioning feature is enabled
 
+OPTION(rgw_list_bucket_min_readahead, OPT_INT, 1000) // minimum number of entries to read from rados for bucket listing
+
 OPTION(mutex_perf_counter, OPT_BOOL, false) // enable/disable mutex perf counter
 OPTION(throttler_perf_counter, OPT_BOOL, true) // enable/disable throttler perf counter
 
index 47ba96261c17d5dbe5c760e53fccd465d4fee15d..00c224133fef357ca2831347d474c6beee3473c1 100644 (file)
@@ -4737,6 +4737,7 @@ int RGWRados::Bucket::List::list_objects(int max, vector<RGWObjEnt> *result,
 
   int count = 0;
   bool truncated = true;
+  int read_ahead = std::max(cct->_conf->rgw_list_bucket_min_readahead,max);
 
   result->clear();
 
@@ -4793,7 +4794,7 @@ int RGWRados::Bucket::List::list_objects(int max, vector<RGWObjEnt> *result,
       ldout(cct, 20) << "setting cur_marker=" << cur_marker.name << "[" << cur_marker.instance << "]" << dendl;
     }
     std::map<string, RGWObjEnt> ent_map;
-    int r = store->cls_bucket_list(bucket, shard_id, cur_marker, cur_prefix, max + 1 - count, params.list_versions, ent_map,
+    int r = store->cls_bucket_list(bucket, shard_id, cur_marker, cur_prefix, read_ahead + 1 - count, params.list_versions, ent_map,
                             &truncated, &cur_marker);
     if (r < 0)
       return r;