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: v16.2.5~58^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F41863%2Fhead;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 (cherry picked from commit 459d59f505e6c40697ffd71f3ce853b187466fa4) Conflicts: src/rgw/rgw_sal_rados.cc --- diff --git a/src/rgw/rgw_sal_rados.cc b/src/rgw/rgw_sal_rados.cc index 5f07e7379b81..778bc9ba0491 100644 --- a/src/rgw/rgw_sal_rados.cc +++ b/src/rgw/rgw_sal_rados.cc @@ -86,7 +86,12 @@ RGWObject *RGWRadosBucket::create_object(const rgw_obj_key &key) return nullptr; } -int RGWRadosBucket::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 RGWRadosBucket::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; @@ -101,13 +106,12 @@ int RGWRadosBucket::remove_bucket(const DoutPrefixProvider *dpp, bool delete_chi 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 << @@ -123,7 +127,7 @@ int RGWRadosBucket::remove_bucket(const DoutPrefixProvider *dpp, bool delete_chi return ret; } } - } while(is_truncated); + } while(results.is_truncated); /* If there's a prefix, then we are aborting multiparts as well */ if (!prefix.empty()) { @@ -1018,7 +1022,7 @@ int RGWRadosStore::cluster_stat(RGWClusterStat& stats) return ret; } -int RGWRadosStore::create_bucket(const DoutPrefixProvider *dpp, +int RGWRadosStore::create_bucket(const DoutPrefixProvider *dpp, RGWUser& u, const rgw_bucket& b, const string& zonegroup_id, rgw_placement_rule& placement_rule,