]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: radosgw_admin remove bucket not purging past 1,000 objects 41140/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Mon, 3 May 2021 21:52:22 +0000 (17:52 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Tue, 4 May 2021 12:41:12 +0000 (08:41 -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>
src/rgw/rgw_sal_rados.cc

index 8c42ca2108a090ccf669e071f44edabfa5805f94..17c62f8862d6a163d049142faab4f6c283b68a5d 100644 (file)
@@ -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()) {