]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: radosgw_admin remove bucket not purging past 1,000 objects 41863/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Mon, 3 May 2021 21:52:22 +0000 (17:52 -0400)
committerCory Snyder <csnyder@iland.com>
Tue, 15 Jun 2021 13:56:43 +0000 (09:56 -0400)
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 <ivancich@redhat.com>
(cherry picked from commit 459d59f505e6c40697ffd71f3ce853b187466fa4)

Conflicts:
src/rgw/rgw_sal_rados.cc

src/rgw/rgw_sal_rados.cc

index 5f07e7379b814141057f24c6e6fddcddae4d0091..778bc9ba04917e27bb8de7922c8ae85fefdbaaaa 100644 (file)
@@ -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,