]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/multisite: - don't overwrite bucket attrs while storing bucket instance info.
authorShilpa Jagannath <smanjara@redhat.com>
Wed, 22 Nov 2023 22:21:29 +0000 (17:21 -0500)
committerShilpa Jagannath <smanjara@redhat.com>
Fri, 4 Apr 2025 17:16:53 +0000 (13:16 -0400)
- get rid of the helper function that adds the 'deleted' log layout.

Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
src/rgw/driver/rados/rgw_rados.cc
src/rgw/driver/rados/rgw_rados.h
src/rgw/driver/rados/rgw_sal_rados.cc
src/rgw/rgw_bucket_layout.h

index 287212fc66c85431cafcdde98d0e6f80456ec3c8..07192a7aa44b973232386b2fcd6f0fc9099606f7 100644 (file)
@@ -5550,7 +5550,7 @@ int RGWRados::check_bucket_empty(const DoutPrefixProvider *dpp, RGWBucketInfo& b
  * bucket: the name of the bucket to delete
  * Returns 0 on success, -ERR# otherwise.
  */
-int RGWRados::delete_bucket(RGWBucketInfo& bucket_info, RGWObjVersionTracker& objv_tracker, optional_yield y, const DoutPrefixProvider *dpp, bool check_empty)
+int RGWRados::delete_bucket(RGWBucketInfo& bucket_info, std::map<std::string, bufferlist>& attrs, RGWObjVersionTracker& objv_tracker, optional_yield y, const DoutPrefixProvider *dpp, bool check_empty)
 {
   const rgw_bucket& bucket = bucket_info.bucket;
   librados::IoCtx index_pool;
@@ -5614,7 +5614,6 @@ int RGWRados::delete_bucket(RGWBucketInfo& bucket_info, RGWObjVersionTracker& ob
                                       cct->_conf->rgw_bucket_index_max_aio)();
   } else {
     bucket_info.flags |= BUCKET_DELETED;
-    map<string, bufferlist> attrs;
 
     r = ctl.bucket->store_bucket_instance_info(bucket, bucket_info, y, dpp, RGWBucketCtl::BucketInstance::PutParams()
                                                                     .set_exclusive(false)
index 96a4a93634aa5d8cef6051fbd5a8b8d2fab1fa60..64bbfe8beae72558a87df49f394c8572148ae738 100644 (file)
@@ -1268,7 +1268,7 @@ int restore_obj_from_cloud(RGWLCCloudTierCtx& tier_ctx,
    * bucket: the name of the bucket to delete
    * Returns 0 on success, -ERR# otherwise.
    */
-  int delete_bucket(RGWBucketInfo& bucket_info, RGWObjVersionTracker& objv_tracker, optional_yield y, const DoutPrefixProvider *dpp, bool check_empty = true);
+  int delete_bucket(RGWBucketInfo& bucket_info, std::map<std::string, bufferlist>& attrs, RGWObjVersionTracker& objv_tracker, optional_yield y, const DoutPrefixProvider *dpp, bool check_empty = true);
 
   void wakeup_meta_sync_shards(std::set<int>& shard_ids);
 
index 3293fafb6295dc41a1ee7d67f05878b3b2a09c4a..a6e7d6eb3cbf27ea96e29c67acd0d4bd18fc5a64 100644 (file)
@@ -446,8 +446,8 @@ int RadosBucket::remove(const DoutPrefixProvider* dpp,
   RGWObjVersionTracker ot;
 
   // if we deleted children above we will force delete, as any that
-  // remain is detritus from a prior bug
-  ret = store->getRados()->delete_bucket(info, ot, y, dpp, !delete_children);
+  // remain is detrius from a prior bug
+  ret = store->getRados()->delete_bucket(info, get_attrs(), ot, y, dpp, !delete_children);
   if (ret < 0) {
     ldpp_dout(dpp, -1) << "ERROR: could not remove bucket " <<
       info.bucket.name << dendl;
index 77cbef946028e792e9fa229083143c19845ec735..647ec5cd2e9a0e79612e210261e2c30a04edda67 100644 (file)
@@ -216,12 +216,6 @@ inline auto matches_gen(uint64_t gen)
   return [gen] (const bucket_log_layout_generation& l) { return l.gen == gen; };
 }
 
-inline bucket_log_layout_generation log_layout_from_deleted_index(
-    uint64_t gen, const bucket_index_layout_generation& index)
-{
-  return {gen, {BucketLogType::Deleted, {index.gen, index.layout.normal}}};
-}
-
 inline bucket_index_layout_generation log_to_index_layout(const bucket_log_layout_generation& log_layout)
 {
   ceph_assert(log_layout.layout.type == BucketLogType::InIndex);