]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgwlc: fix delete marker regression in currentversion lc expiration 54372/head
authorMatt Benjamin <mbenjamin@redhat.com>
Mon, 6 Nov 2023 20:11:58 +0000 (15:11 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Mon, 6 Nov 2023 20:11:58 +0000 (15:11 -0500)
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 <mbenjamin@redhat.com>
src/rgw/rgw_lc.cc

index 15e70977e726f1eebb3bbfc846e2fc5ecc548b5e..a375b63e0c2da0e4be0e7f6f3836552edee18c5f 100644 (file)
@@ -522,15 +522,19 @@ static int remove_expired_obj(
   auto& version_id = obj_key.instance;
   std::unique_ptr<rgw::sal::Notification> notify;
 
+  std::unique_ptr<rgw::sal::User> 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<rgw::sal::User> 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);