]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgwlc: remove lc entry on bucket delete 36308/head
authorMatt Benjamin <mbenjamin@redhat.com>
Tue, 4 Jan 2022 16:22:00 +0000 (11:22 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Tue, 4 Jan 2022 16:51:44 +0000 (11:51 -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>
src/rgw/rgw_sal_rados.cc

index 128fb984351dc21ecec2b45cbc2fe4517cba609a..17ee63b2f0a26f0a95422395d9b10d59f92ca217 100644 (file)
@@ -34,6 +34,7 @@
 #include "rgw_zone.h"
 #include "rgw_rest_conn.h"
 #include "rgw_service.h"
+#include "rgw_lc.h"
 #include "services/svc_sys_obj.h"
 #include "services/svc_zone.h"
 #include "services/svc_tier_rados.h"
@@ -390,6 +391,10 @@ int RadosBucket::remove_bucket(const DoutPrefixProvider* dpp,
     return ret;
   }
 
+  // remove lifecycle config, if any (XXX note could be made generic)
+  (void) store->getRados()->get_lc()->remove_bucket_config(
+    this, get_attrs());
+
   ret = store->ctl()->bucket->sync_user_stats(dpp, info.owner, info, y);
   if (ret < 0) {
      ldout(store->ctx(), 1) << "WARNING: failed sync user stats before bucket delete. ret=" <<  ret << dendl;