]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: introduce rgw_list_bucket_min_readahead parameter for bucket listing from rados
authorAbhishek Varshney <abhishek.varshney@flipkart.com>
Tue, 26 Apr 2016 08:54:29 +0000 (14:24 +0530)
committerBoris Ranto <branto@redhat.com>
Fri, 6 May 2016 11:44:16 +0000 (13:44 +0200)
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 6b4ece733c9ab5e1549682c598b259eaf1ccaeb9..1d4a846db33f6b7c7e793f9886895ae101cbb7c5 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;