]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: using put() method of metadata backend to ensure that role
authorPritha Srivastava <prsrivas@redhat.com>
Wed, 17 Nov 2021 15:19:56 +0000 (20:49 +0530)
committerPritha Srivastava <prsrivas@redhat.com>
Thu, 8 Sep 2022 05:17:14 +0000 (10:47 +0530)
metadata is written to md log in method store_info().

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
(cherry picked from commit 36169ca69fa874c7e79f698c1561226dec0c0f31)

src/rgw/rgw_sal_rados.cc

index 9134c97201a035b5d48d613d842972438b6a51c0..bfb6ea2d169233f6695808fd2343a2b4af7d9f90 100644 (file)
@@ -2823,7 +2823,7 @@ int RadosOIDCProvider::delete_obj(const DoutPrefixProvider *dpp, optional_yield
 int RadosRole::store_info(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y)
 {
   using ceph::encode;
-  auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
+  //auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
   std::string oid = get_info_oid_prefix() + id;
 
   bufferlist bl;
@@ -2835,11 +2835,15 @@ int RadosRole::store_info(const DoutPrefixProvider *dpp, bool exclusive, optiona
     attrs.emplace("tagging", bl_tags);
   }
 
+  RGWSI_MBSObj_PutParams params(bl, &attrs, mtime, exclusive);
+  return store->svc()->meta_be_sobj->put(store->svc()->meta_be_sobj->alloc_ctx(), oid, params, &objv_tracker, y, dpp);
+  #if 0
   if (!attrs.empty()) {
     return rgw_put_system_obj(dpp, obj_ctx, store->get_zone()->get_params().roles_pool, oid, bl, exclusive, nullptr, mtime, y, &attrs);
   }
 
   return rgw_put_system_obj(dpp, obj_ctx, store->get_zone()->get_params().roles_pool, oid, bl, exclusive, nullptr, mtime, y);
+  #endif
 }
 
 int RadosRole::store_name(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y)
@@ -2854,7 +2858,7 @@ int RadosRole::store_name(const DoutPrefixProvider *dpp, bool exclusive, optiona
   using ceph::encode;
   encode(nameToId, bl);
 
-  return rgw_put_system_obj(dpp, obj_ctx, store->get_zone()->get_params().roles_pool, oid, bl, exclusive, nullptr, real_time(), y);
+  return rgw_put_system_obj(dpp, obj_ctx, store->get_zone()->get_params().roles_pool, oid, bl, exclusive, &objv_tracker, real_time(), y);
 }
 
 int RadosRole::store_path(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y)
@@ -2864,7 +2868,7 @@ int RadosRole::store_path(const DoutPrefixProvider *dpp, bool exclusive, optiona
 
   bufferlist bl;
 
-  return rgw_put_system_obj(dpp, obj_ctx, store->get_zone()->get_params().roles_pool, oid, bl, exclusive, nullptr, real_time(), y);
+  return rgw_put_system_obj(dpp, obj_ctx, store->get_zone()->get_params().roles_pool, oid, bl, exclusive, &objv_tracker, real_time(), y);
 }
 
 int RadosRole::read_id(const DoutPrefixProvider *dpp, const std::string& role_name, const std::string& tenant, std::string& role_id, optional_yield y)
@@ -2923,7 +2927,7 @@ int RadosRole::read_info(const DoutPrefixProvider *dpp, optional_yield y)
   std::string oid = get_info_oid_prefix() + id;
   bufferlist bl;
 
-  int ret = rgw_get_system_obj(obj_ctx, store->get_zone()->get_params().roles_pool, oid, bl, &objv_tracker, &mtime, null_yield, dpp, &attrs, nullptr, boost::none, true);
+  int ret = rgw_get_system_obj(obj_ctx, store->svc()->zone->get_zone_params().roles_pool, oid, bl, &objv_tracker, &mtime, null_yield, dpp, &attrs, nullptr, boost::none, true);
   if (ret < 0) {
     ldpp_dout(dpp, 0) << "ERROR: failed reading role info from Role pool: " << id << ": " << cpp_strerror(-ret) << dendl;
     return ret;