]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgwlc: even current object versions have a unique instance 54425/head
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 15 Nov 2023 18:39:18 +0000 (13:39 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Thu, 4 Jan 2024 20:23:36 +0000 (15:23 -0500)
Fixes: https://tracker.ceph.com/issues/63546
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_lc.cc

index fec80339d0ffb9045e7a01c994a612f944a2e47e..4364c2e683c86ae683809b046f621e18927c6b8d 100644 (file)
@@ -522,7 +522,7 @@ static int remove_expired_obj(
   auto obj_key = o.key;
   auto& meta = o.meta;
   int ret;
-  auto& version_id = obj_key.instance;
+  auto version_id = obj_key.instance; // deep copy, so not cleared below
   std::unique_ptr<rgw::sal::Notification> notify;
 
   /* per discussion w/Daniel, Casey,and Eric, we *do need*
@@ -849,7 +849,7 @@ int RGWLC::handle_multipart_expiration(rgw::sal::Bucket* target,
          target, lc_id,
          const_cast<std::string&>(target->get_tenant()),
          lc_req_id, null_yield);
-      auto& version_id = obj.key.instance;
+      auto version_id = obj.key.instance;
 
       ret = notify->publish_reserve(this, nullptr);
       if (ret < 0) {
@@ -1356,7 +1356,7 @@ public:
        bucket, lc_id,
        const_cast<std::string&>(oc.bucket->get_tenant()),
        lc_req_id, null_yield);
-    auto& version_id = oc.o.key.instance;
+    auto version_id = oc.o.key.instance;
 
     ret = notify->publish_reserve(oc.dpp, nullptr);
     if (ret < 0) {