From f63bf47aa464c345c907c748dfdbbc5a239d8488 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 --- 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 3b83ffc8b1c5..89faeaaa6b20 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -4476,12 +4476,12 @@ int RGWRados::transition_obj(RGWObjectCtx& obj_ctx, int RGWRados::check_bucket_empty(RGWBucketInfo& bucket_info, optional_yield y) { - 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.47.3