From: Matt Benjamin Date: Mon, 6 Nov 2023 20:11:58 +0000 (-0500) Subject: rgwlc: fix delete marker regression in currentversion lc expiration X-Git-Tag: v19.0.0~137^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6ae78884d8f071d6a92d375bd2befbaea61d671f;p=ceph-ci.git rgwlc: fix delete marker regression in currentversion lc expiration Fixes a regression introduced in https://github.com/ceph/ceph/pull/50680, which attempted to re-use an already created sal object handle as an optimiztion. This change suppressed creation of delete markers in current version expiration when buckets are versioned. Fixes: https://tracker.ceph.com/issues/63458 Signed-off-by: Matt Benjamin --- diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index 15e70977e72..a375b63e0c2 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -522,15 +522,19 @@ static int remove_expired_obj( auto& version_id = obj_key.instance; std::unique_ptr notify; + std::unique_ptr user; + user = driver->get_user(bucket_info.owner); + + /* per discussion w/Daniel, Casey,and Eric, we *do need* + * a new sal object handle, based on the following decision + * to clear obj_key.instance--which happens in the case + * where a delete marker should be created */ if (!remove_indeed) { obj_key.instance.clear(); } else if (obj_key.instance.empty()) { obj_key.instance = "null"; } - - auto& obj = oc.obj; - std::unique_ptr user; - user = driver->get_user(bucket_info.owner); + auto obj = oc.bucket->get_object(obj_key); RGWObjState* obj_state{nullptr}; ret = obj->get_obj_state(dpp, &obj_state, null_yield, true);