]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: clear ent_list for each loop of bucket list 34099/head
authorYao Zongyou <yaozongyou@vip.qq.com>
Tue, 3 Mar 2020 15:34:26 +0000 (15:34 +0000)
committerShyukri Shyukriev <shshyukriev@suse.com>
Fri, 20 Mar 2020 21:14:51 +0000 (23:14 +0200)
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 <yaozongyou@vip.qq.com>
(cherry picked from commit f63bf47aa464c345c907c748dfdbbc5a239d8488)

src/rgw/rgw_rados.cc

index 3ca96d8e7b5ddb47b477cd5dc3b050e74da0cae0..427dfbeb0c7a9a1544458237e622f40700ef9b95 100644 (file)
@@ -4981,12 +4981,12 @@ int RGWRados::transition_obj(RGWObjectCtx& obj_ctx,
 
 int RGWRados::check_bucket_empty(RGWBucketInfo& bucket_info)
 {
-  std::vector<rgw_bucket_dir_entry> ent_list;
   rgw_obj_index_key marker;
   string prefix;
   bool is_truncated;
 
   do {
+    std::vector<rgw_bucket_dir_entry> ent_list;
     constexpr uint NUM_ENTRIES = 1000u;
     int r = cls_bucket_list_unordered(bucket_info,
                                      RGW_NO_SHARD,