]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/lc: bucket delete only calls remove_bucket_config() if RGW_ATTR_LC 52960/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 11 Aug 2023 17:29:26 +0000 (13:29 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 11 Aug 2023 20:52:53 +0000 (16:52 -0400)
if there's no RGW_ATTR_LC, don't try to do any lifecycle-related cleanup

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/driver/rados/rgw_sal_rados.cc

index a8914921fd24dd8369e87132f82eb0d19f53a8f0..4f08fb66a846bf4a5f8a60f6cc7ec96462ce5cb8 100644 (file)
@@ -451,9 +451,11 @@ int RadosBucket::remove_bucket(const DoutPrefixProvider* dpp,
   }
 
   // remove lifecycle config, if any (XXX note could be made generic)
-  constexpr bool merge_attrs = false; // don't update xattrs, we're deleting
-  (void) store->getRados()->get_lc()->remove_bucket_config(
-    this, get_attrs(), merge_attrs);
+  if (get_attrs().count(RGW_ATTR_LC)) {
+    constexpr bool merge_attrs = false; // don't update xattrs, we're deleting
+    (void) store->getRados()->get_lc()->remove_bucket_config(
+      this, get_attrs(), merge_attrs);
+  }
 
   ret = store->ctl()->bucket->sync_user_stats(dpp, info.owner, info, y, nullptr);
   if (ret < 0) {