From: J. Eric Ivancich Date: Mon, 3 May 2021 21:52:22 +0000 (-0400) Subject: rgw: radosgw_admin remove bucket not purging past 1,000 objects X-Git-Tag: v17.1.0~2028^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=459d59f505e6c40697ffd71f3ce853b187466fa4;p=ceph.git rgw: radosgw_admin remove bucket not purging past 1,000 objects The zipper refactoring combines use of old is_truncated variable and newer structure that manages is_truncated. This prevented advancing past the first page of 1,000 entries. Signed-off-by: J. Eric Ivancich --- diff --git a/src/rgw/rgw_sal_rados.cc b/src/rgw/rgw_sal_rados.cc index 8c42ca2108a0..17c62f8862d6 100644 --- a/src/rgw/rgw_sal_rados.cc +++ b/src/rgw/rgw_sal_rados.cc @@ -214,7 +214,12 @@ Object* RadosBucket::create_object(const rgw_obj_key &key) return nullptr; } -int RadosBucket::remove_bucket(const DoutPrefixProvider* dpp, bool delete_children, std::string prefix, std::string delimiter, bool forward_to_master, req_info* req_info, optional_yield y) +int RadosBucket::remove_bucket(const DoutPrefixProvider* dpp, + bool delete_children, + std::string prefix, + std::string delimiter, + bool forward_to_master, + req_info* req_info, optional_yield y) { int ret; @@ -229,13 +234,12 @@ int RadosBucket::remove_bucket(const DoutPrefixProvider* dpp, bool delete_childr ListResults results; - bool is_truncated = false; do { results.objs.clear(); - ret = list(dpp, params, 1000, results, y); - if (ret < 0) - return ret; + ret = list(dpp, params, 1000, results, y); + if (ret < 0) + return ret; if (!results.objs.empty() && !delete_children) { ldpp_dout(dpp, -1) << "ERROR: could not remove non-empty bucket " << info.bucket.name << @@ -251,7 +255,7 @@ int RadosBucket::remove_bucket(const DoutPrefixProvider* dpp, bool delete_childr return ret; } } - } while(is_truncated); + } while(results.is_truncated); /* If there's a prefix, then we are aborting multiparts as well */ if (!prefix.empty()) {