Skip to content

Commit 6ae7888

Browse files
committed
rgwlc: fix delete marker regression in currentversion lc expiration
Fixes a regression introduced in ceph#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 <mbenjamin@redhat.com>
1 parent ab76a74 commit 6ae7888

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/rgw/rgw_lc.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -522,15 +522,19 @@ static int remove_expired_obj(
522522
auto& version_id = obj_key.instance;
523523
std::unique_ptr<rgw::sal::Notification> notify;
524524

525+
std::unique_ptr<rgw::sal::User> user;
526+
user = driver->get_user(bucket_info.owner);
527+
528+
/* per discussion w/Daniel, Casey,and Eric, we *do need*
529+
* a new sal object handle, based on the following decision
530+
* to clear obj_key.instance--which happens in the case
531+
* where a delete marker should be created */
525532
if (!remove_indeed) {
526533
obj_key.instance.clear();
527534
} else if (obj_key.instance.empty()) {
528535
obj_key.instance = "null";
529536
}
530-
531-
auto& obj = oc.obj;
532-
std::unique_ptr<rgw::sal::User> user;
533-
user = driver->get_user(bucket_info.owner);
537+
auto obj = oc.bucket->get_object(obj_key);
534538

535539
RGWObjState* obj_state{nullptr};
536540
ret = obj->get_obj_state(dpp, &obj_state, null_yield, true);

0 commit comments

Comments
 (0)