Skip to content

Commit cebd5d5

Browse files
committed
rgw/lc: bucket delete only calls remove_bucket_config() if RGW_ATTR_LC
if there's no RGW_ATTR_LC, don't try to do any lifecycle-related cleanup Signed-off-by: Casey Bodley <[email protected]>
1 parent e7a97d0 commit cebd5d5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/rgw/driver/rados/rgw_sal_rados.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,11 @@ int RadosBucket::remove_bucket(const DoutPrefixProvider* dpp,
451451
}
452452

453453
// remove lifecycle config, if any (XXX note could be made generic)
454-
constexpr bool merge_attrs = false; // don't update xattrs, we're deleting
455-
(void) store->getRados()->get_lc()->remove_bucket_config(
456-
this, get_attrs(), merge_attrs);
454+
if (get_attrs().count(RGW_ATTR_LC)) {
455+
constexpr bool merge_attrs = false; // don't update xattrs, we're deleting
456+
(void) store->getRados()->get_lc()->remove_bucket_config(
457+
this, get_attrs(), merge_attrs);
458+
}
457459

458460
ret = store->ctl()->bucket->sync_user_stats(dpp, info.owner, info, y, nullptr);
459461
if (ret < 0) {

0 commit comments

Comments
 (0)