]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgwlc: remove lc entry on bucket delete 44730/head
authorMatt Benjamin <mbenjamin@redhat.com>
Tue, 4 Jan 2022 16:22:00 +0000 (11:22 -0500)
committerCory Snyder <csnyder@iland.com>
Fri, 21 Jan 2022 18:41:25 +0000 (13:41 -0500)
Buckets with lifecycle policies installed have a state entry that
must also be deleted when the bucket is removed.

Fixes: https://tracker.ceph.com/issues/46728
N.b., should really be generic, not specific to the RADOS store, but
there doesn't seem to be a clean model for implementing generic side
effects in Zipper, currently.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit cc1e812a003e2af74fe0c69ccae08dd7aa68bbe0)

Conflicts:
src/rgw/rgw_sal_rados.cc

Cherry-pick notes:
- Code from rgw_sal_rados.cc existed in rgw_sal.cc in Octopus

src/rgw/rgw_sal.cc

index 65880a4757ff8c5b06bec0c680c7c15cd9b1c9ec..53079f66a783590795f7aaa6fd38ca30a813564a 100644 (file)
@@ -22,6 +22,7 @@
 #include "common/errno.h"
 
 #include "rgw_sal.h"
+#include "rgw_lc.h"
 #include "rgw_bucket.h"
 #include "rgw_multi.h"
 
@@ -133,6 +134,10 @@ int RGWRadosBucket::remove_bucket(bool delete_children, optional_yield y)
     return ret;
   }
 
+  // remove lifecycle config, if any (XXX note could be made generic)
+  (void) store->getRados()->get_lc()->remove_bucket_config(
+          get_info(), get_attrs());
+
   ret = store->ctl()->bucket->sync_user_stats(info.owner, info);
   if ( ret < 0) {
      ldout(store->ctx(), 1) << "WARNING: failed sync user stats before bucket delete. ret=" <<  ret << dendl;