From 80755e33964ddaab7081da20da3552268893eebd Mon Sep 17 00:00:00 2001 From: Pavan Rallabhandi Date: Thu, 22 Jun 2017 13:29:16 +0530 Subject: [PATCH] rgw: Have an option to not to fetch bucket stats upon bucket listing Fixes: http://tracker.ceph.com/issues/20377 Signed-off-by: Pavan Rallabhandi --- src/common/config_opts.h | 2 ++ src/rgw/rgw_rest_swift.cc | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index c9615c4a650..deac4df6a4b 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -1752,6 +1752,8 @@ OPTION(debug_deliberately_leak_memory, OPT_BOOL, false) OPTION(rgw_swift_custom_header, OPT_STR, "") // option to enable swift custom headers +OPTION(rgw_swift_need_stats, OPT_BOOL, true) // option to enable stats on bucket listing for swift + /* resharding tunables */ OPTION(rgw_reshard_num_logs, OPT_INT, 16) OPTION(rgw_reshard_bucket_lock_duration, OPT_INT, 120) // duration of lock on bucket obj during resharding diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index a3ccdca781a..a56b8a01de1 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -54,7 +54,7 @@ int RGWListBuckets_ObjStore_SWIFT::get_params() limit = (uint64_t)l; } - if (need_stats) { + if (s->cct->_conf->rgw_swift_need_stats) { bool stats, exists; int r = s->info.args.get_bool("stats", &stats, &exists); @@ -65,6 +65,8 @@ int RGWListBuckets_ObjStore_SWIFT::get_params() if (exists) { need_stats = stats; } + } else { + need_stats = false; } return 0; -- 2.47.3