From 1d1a471de4b6ffe4eec289d0b39438cf6c15051e Mon Sep 17 00:00:00 2001 From: Yao Zongyou Date: Tue, 3 Mar 2020 15:34:26 +0000 Subject: [PATCH] rgw: clear ent_list for each loop of bucket list if ent_list is not cleared, the old element will be checked repeatedly and will occupy more memory. Fixes: http://tracker.ceph.com/issues/44394 Signed-off-by: Yao Zongyou (cherry picked from commit f63bf47aa464c345c907c748dfdbbc5a239d8488) --- src/rgw/rgw_rados.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 3ca96d8e7b5dd..427dfbeb0c7a9 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -4981,12 +4981,12 @@ int RGWRados::transition_obj(RGWObjectCtx& obj_ctx, int RGWRados::check_bucket_empty(RGWBucketInfo& bucket_info) { - std::vector ent_list; rgw_obj_index_key marker; string prefix; bool is_truncated; do { + std::vector ent_list; constexpr uint NUM_ENTRIES = 1000u; int r = cls_bucket_list_unordered(bucket_info, RGW_NO_SHARD, -- 2.39.5