]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: rgw_rados.cc mostly compiles
authorYehuda Sadeh <yehuda@redhat.com>
Sat, 15 Jun 2019 02:33:46 +0000 (19:33 -0700)
committerCasey Bodley <cbodley@redhat.com>
Mon, 29 Jul 2019 19:20:49 +0000 (15:20 -0400)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
34 files changed:
src/rgw/rgw_admin.cc
src/rgw/rgw_auth.cc
src/rgw/rgw_bucket.cc
src/rgw/rgw_bucket.h
src/rgw/rgw_cr_tools.cc
src/rgw/rgw_data_sync.cc
src/rgw/rgw_op.cc
src/rgw/rgw_pubsub.cc
src/rgw/rgw_quota.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h
src/rgw/rgw_rest.cc
src/rgw/rgw_rest_log.cc
src/rgw/rgw_rest_log.h
src/rgw/rgw_rest_realm.cc
src/rgw/rgw_rest_role.cc
src/rgw/rgw_rest_swift.cc
src/rgw/rgw_rest_user_policy.cc
src/rgw/rgw_sts.cc
src/rgw/rgw_trim_datalog.cc
src/rgw/rgw_trim_mdlog.cc
src/rgw/rgw_user.cc
src/rgw/rgw_user.h
src/rgw/rgw_zone.cc
src/rgw/services/svc_bi_rados.cc
src/rgw/services/svc_bi_rados.h
src/rgw/services/svc_mdlog.cc
src/rgw/services/svc_rados.cc
src/rgw/services/svc_rados.h
src/rgw/services/svc_user.h
src/rgw/services/svc_user_rados.cc
src/rgw/services/svc_user_rados.h
src/rgw/services/svc_zone.cc
src/rgw/services/svc_zone.h

index 22e1341f1546e3e174b3d706dca3cd7481d73181..8b7e3841a7fdcb6888d3e128b03c5cc28b84fe41 100644 (file)
@@ -2029,7 +2029,7 @@ stringstream& push_ss(stringstream& ss, list<string>& l, int tab = 0)
 
 static void get_md_sync_status(list<string>& status)
 {
-  RGWMetaSyncStatusManager sync(store, store->get_async_rados());
+  RGWMetaSyncStatusManager sync(store, store->svc.rados->get_async_processor());
 
   int ret = sync.init();
   if (ret < 0) {
@@ -2179,7 +2179,7 @@ static void get_data_sync_status(const string& source_zone, list<string>& status
     flush_ss(ss, status);
     return;
   }
-  RGWDataSyncStatusManager sync(store, store->get_async_rados(), source_zone, nullptr);
+  RGWDataSyncStatusManager sync(store, store->svc.rados->get_async_processor(), source_zone, nullptr);
 
   int ret = sync.init();
   if (ret < 0) {
@@ -6757,7 +6757,7 @@ next:
        cerr << "ERROR: recalculate doesn't work on buckets" << std::endl;
        return EINVAL;
       }
-      ret = store->cls_user_reset_stats(user_str);
+      ret = store->ctl.user->reset_bucket_stats(user_id);
       if (ret < 0) {
        cerr << "ERROR: could not clear user stats: " << cpp_strerror(-ret) << std::endl;
        return -ret;
@@ -7025,7 +7025,7 @@ next:
   }
 
   if (opt_cmd == OPT_METADATA_SYNC_STATUS) {
-    RGWMetaSyncStatusManager sync(store, store->get_async_rados());
+    RGWMetaSyncStatusManager sync(store, store->svc.rados->get_async_processor());
 
     int ret = sync.init();
     if (ret < 0) {
@@ -7066,7 +7066,7 @@ next:
   }
 
   if (opt_cmd == OPT_METADATA_SYNC_INIT) {
-    RGWMetaSyncStatusManager sync(store, store->get_async_rados());
+    RGWMetaSyncStatusManager sync(store, store->svc.rados->get_async_processor());
 
     int ret = sync.init();
     if (ret < 0) {
@@ -7082,7 +7082,7 @@ next:
 
 
   if (opt_cmd == OPT_METADATA_SYNC_RUN) {
-    RGWMetaSyncStatusManager sync(store, store->get_async_rados());
+    RGWMetaSyncStatusManager sync(store, store->svc.rados->get_async_processor());
 
     int ret = sync.init();
     if (ret < 0) {
@@ -7102,7 +7102,7 @@ next:
       cerr << "ERROR: source zone not specified" << std::endl;
       return EINVAL;
     }
-    RGWDataSyncStatusManager sync(store, store->get_async_rados(), source_zone, nullptr);
+    RGWDataSyncStatusManager sync(store, store->svc.rados->get_async_processor(), source_zone, nullptr);
 
     int ret = sync.init();
     if (ret < 0) {
@@ -7166,7 +7166,7 @@ next:
       return EINVAL;
     }
 
-    RGWDataSyncStatusManager sync(store, store->get_async_rados(), source_zone, nullptr);
+    RGWDataSyncStatusManager sync(store, store->svc.rados->get_async_processor(), source_zone, nullptr);
 
     int ret = sync.init();
     if (ret < 0) {
@@ -7195,7 +7195,7 @@ next:
       return ret;
     }
 
-    RGWDataSyncStatusManager sync(store, store->get_async_rados(), source_zone, nullptr, sync_module);
+    RGWDataSyncStatusManager sync(store, store->svc.rados->get_async_processor(), source_zone, nullptr, sync_module);
 
     ret = sync.init();
     if (ret < 0) {
index f04a9794bb87be601fc3d49e0ebe5386c9c9a5a2..90545cfbbce5ac5ab154b0259b8af79dda913885 100644 (file)
@@ -470,7 +470,7 @@ void rgw::auth::RemoteApplier::create_account(const DoutPrefixProvider* dpp,
   rgw_apply_default_bucket_quota(user_info.bucket_quota, cct->_conf);
   rgw_apply_default_user_quota(user_info.user_quota, cct->_conf);
 
-  int ret = user_ctl->store_info(user_info, RGWUserCtl::PutParams()
+  int ret = ctl->user->store_info(user_info, RGWUserCtl::PutParams()
                                                    .set_exclusive(true));
   if (ret < 0) {
     ldpp_dout(dpp, 0) << "ERROR: failed to store new user info: user="
@@ -501,13 +501,13 @@ void rgw::auth::RemoteApplier::load_acct_info(const DoutPrefixProvider* dpp, RGW
   if (acct_user.tenant.empty()) {
     const rgw_user tenanted_uid(acct_user.id, acct_user.id);
 
-    if (user_ctl->get_info_by_uid( tenanted_uid, &user_info) >= 0) {
+    if (ctl->user->get_info_by_uid( tenanted_uid, &user_info) >= 0) {
       /* Succeeded. */
       return;
     }
   }
 
-  if (user_ctl->get_info_by_uid( acct_user, &user_info) < 0) {
+  if (ctl->user->get_info_by_uid( acct_user, &user_info) < 0) {
     ldpp_dout(dpp, 0) << "NOTICE: couldn't map swift user " << acct_user << dendl;
     create_account(dpp, acct_user, user_info);
   }
index 902f9deed962ad2840dae85426bfc1e760db4add..d969e18f1898586a2d40db52366368e5bd40c999 100644 (file)
@@ -3018,6 +3018,7 @@ int RGWBucketCtl::remove_bucket_entrypoint_info(const rgw_bucket& bucket,
 
 int RGWBucketCtl::read_bucket_instance_info(const rgw_bucket& bucket,
                                             RGWBucketInfo *info,
+                                            optional_yield y,
                                             ceph::optional_ref_default<RGWBucketCtl::BucketInstance::GetParams> _params)
 {
   auto& params = *_params;
index 1588b66ab5ddc721f531985f66503caa6c401145..21fe57531bb91653363c440b78b716195aa917ba 100644 (file)
@@ -764,11 +764,12 @@ public:
   /* bucket instance */
   int read_bucket_instance_info(const rgw_bucket& bucket,
                                   RGWBucketInfo *info,
+                                  optional_yield y,
                                   ceph::optional_ref_default<RGWBucketCtl::BucketInstance::GetParams> params = std::nullopt);
   int store_bucket_instance_info(const rgw_bucket& bucket,
-                                   RGWBucketInfo& info,
-                                   optional_yield y,
-                                   ceph::optional_ref_default<RGWBucketCtl::BucketInstance::PutParams> params = std::nullopt);
+                                 RGWBucketInfo& info,
+                                 optional_yield y,
+                                 ceph::optional_ref_default<RGWBucketCtl::BucketInstance::PutParams> params = std::nullopt);
   int remove_bucket_instance_info(const rgw_bucket& bucket,
                                   optional_yield y,
                                   RGWBucketInfo& info,
index 7962f2aaa4a21f05e5da0f79dc3a31bdf2fbbadf..90c8f6c25587e281e9dafd75ec1f317ecc250b9e 100644 (file)
@@ -89,7 +89,7 @@ int RGWUserCreateCR::Request::_send_request()
 template<>
 int RGWGetUserInfoCR::Request::_send_request()
 {
-  return store->ctl.user->get_info_by_uid(params.user, result);
+  return store->ctl.user->get_info_by_uid(params.user, result.get(), nullopt);
 }
 
 template<>
@@ -137,7 +137,7 @@ int RGWBucketCreateLocalCR::Request::_send_request()
   bucket_owner.set_id(user);
   bucket_owner.set_name(user_info->display_name);
   if (bucket_exists) {
-    ret = rgw_op_get_bucket_policy_from_attr(cct, store, bucket_info,
+    ret = rgw_op_get_bucket_policy_from_attr(cct, store->ctl.user, bucket_info,
                                              bucket_attrs, &old_policy);
     if (ret >= 0)  {
       if (old_policy.get_owner().get_id().compare(user) != 0) {
index 65b4ecf727a31845590d7b0769b1a5d00fba568f..0dbb851a89242a4f33984190e58fccd2ffa51266 100644 (file)
@@ -3430,7 +3430,7 @@ int RGWBucketSyncStatusManager::init()
 
   int effective_num_shards = (num_shards ? num_shards : 1);
 
-  auto async_rados = store->get_async_rados();
+  auto async_rados = store->svc.rados->get_async_processor();
 
   for (int i = 0; i < effective_num_shards; i++) {
     RGWRemoteBucketLog *l = new RGWRemoteBucketLog(this, store, this, async_rados, &http_manager);
@@ -3570,7 +3570,7 @@ int rgw_bucket_sync_status(const DoutPrefixProvider *dpp, RGWRados *store, const
 
   RGWDataSyncEnv env;
   RGWSyncModuleInstanceRef module; // null sync module
-  env.init(dpp, store->ctx(), store, nullptr, store->get_async_rados(),
+  env.init(dpp, store->ctx(), store, nullptr, store->svc.rados->get_async_processor(),
            nullptr, nullptr, nullptr, source_zone, module, nullptr);
 
   RGWCoroutinesManager crs(store->ctx(), store->get_cr_registry());
index da8007c7b0dad3ac0ed81e3e4b51fc83b9253334..5238b88d390f8ec12a382fc6e488eb50d2ebdb77 100644 (file)
@@ -205,7 +205,7 @@ static int get_user_policy_from_attr(CephContext * const cct,
 }
 
 static int get_bucket_instance_policy_from_attr(CephContext *cct,
-                                               RGWRados *store,
+                                               RGWUserCtl *user_ctl,
                                                RGWBucketInfo& bucket_info,
                                                map<string, bufferlist>& bucket_attrs,
                                                RGWAccessControlPolicy *policy)
@@ -220,7 +220,7 @@ static int get_bucket_instance_policy_from_attr(CephContext *cct,
     ldout(cct, 0) << "WARNING: couldn't find acl header for bucket, generating default" << dendl;
     RGWUserInfo uinfo;
     /* object exists, but policy is broken */
-    int r = rgw_get_user_info_by_uid(store, bucket_info.owner, uinfo);
+    int r = rgw_get_user_info_by_uid(user_ctl, bucket_info.owner, uinfo);
     if (r < 0)
       return r;
 
@@ -283,7 +283,7 @@ static int get_obj_policy_from_attr(CephContext *cct,
  * Returns: 0 on success, -ERR# otherwise.
  */
 int rgw_op_get_bucket_policy_from_attr(CephContext *cct,
-                                       RGWRados *store,
+                                       RGWUserCtl *user_ctl,
                                        RGWBucketInfo& bucket_info,
                                        map<string, bufferlist>& bucket_attrs,
                                        RGWAccessControlPolicy *policy)
@@ -457,7 +457,7 @@ static int modify_obj_attr(RGWRados *store, struct req_state *s, const rgw_obj&
   return store->set_attrs(s->obj_ctx, s->bucket_info, read_op.state.obj, attrs, NULL, s->yield);
 }
 
-static int read_bucket_policy(RGWRados *store,
+static int read_bucket_policy(RGWUserCtl *user_ctl,
                               struct req_state *s,
                               RGWBucketInfo& bucket_info,
                               map<string, bufferlist>& bucket_attrs,
@@ -474,7 +474,7 @@ static int read_bucket_policy(RGWRados *store,
     return 0;
   }
 
-  int ret = rgw_op_get_bucket_policy_from_attr(s->cct, store, bucket_info, bucket_attrs, policy);
+  int ret = rgw_op_get_bucket_policy_from_attr(s->cct, user_ctl, bucket_info, bucket_attrs, policy);
   if (ret == -ENOENT) {
       ret = -ERR_NO_SUCH_BUCKET;
   }
@@ -520,7 +520,7 @@ static int read_obj_policy(RGWRados *store,
     /* object does not exist checking the bucket's ACL to make sure
        that we send a proper error code */
     RGWAccessControlPolicy bucket_policy(s->cct);
-    ret = rgw_op_get_bucket_policy_from_attr(s->cct, store, bucket_info, bucket_attrs, &bucket_policy);
+    ret = rgw_op_get_bucket_policy_from_attr(s->cct, store->ctl.user, bucket_info, bucket_attrs, &bucket_policy);
     if (ret < 0) {
       return ret;
     }
@@ -692,7 +692,7 @@ int rgw_build_bucket_policies(RGWRados* store, struct req_state* s)
   /* handle user ACL only for those APIs which support it */
   if (s->user_acl) {
     map<string, bufferlist> uattrs;
-    ret = rgw_get_user_attrs_by_uid(store, acct_acl_user.uid, uattrs);
+    ret = store->ctl.user->get_attrs_by_uid(acct_acl_user.uid, &uattrs);
     if (!ret) {
       ret = get_user_policy_from_attr(s->cct, store, uattrs, *s->user_acl);
     }
@@ -718,7 +718,7 @@ int rgw_build_bucket_policies(RGWRados* store, struct req_state* s)
   if (! s->user->user_id.empty() && s->auth.identity->get_identity_type() != TYPE_ROLE) {
     try {
       map<string, bufferlist> uattrs;
-      if (ret = rgw_get_user_attrs_by_uid(store, s->user->user_id, uattrs); ! ret) {
+      if (ret = store->ctl.user->get_attrs_by_uid(s->user->user_id, &uattrs); ! ret) {
         if (s->iam_user_policies.empty()) {
           s->iam_user_policies = get_iam_user_policy_from_attr(s->cct, store, uattrs, s->user->user_id.tenant);
         } else {
@@ -1276,7 +1276,7 @@ int RGWOp::init_quota()
   if (s->user->user_id == s->bucket_owner.get_id()) {
     uinfo = s->user;
   } else {
-    int r = rgw_get_user_info_by_uid(store, s->bucket_info.owner, owner_info);
+    int r = store->ctl.user->get_info_by_uid(s->bucket_info.owner, &owner_info);
     if (r < 0)
       return r;
     uinfo = &owner_info;
@@ -1788,7 +1788,7 @@ int RGWGetObj::handle_user_manifest(const char *prefix)
     bucket = bucket_info.bucket;
     pbucket_info = &bucket_info;
     bucket_acl = &_bucket_acl;
-    r = read_bucket_policy(store, s, bucket_info, bucket_attrs, bucket_acl, bucket);
+    r = read_bucket_policy(store->ctl.user, s, bucket_info, bucket_attrs, bucket_acl, bucket);
     if (r < 0) {
       ldpp_dout(this, 0) << "failed to read bucket policy" << dendl;
       return r;
@@ -1921,7 +1921,7 @@ int RGWGetObj::handle_slo_manifest(bufferlist& bl)
         }
         bucket = bucket_info.bucket;
         bucket_acl = &_bucket_acl;
-        r = read_bucket_policy(store, s, bucket_info, bucket_attrs, bucket_acl,
+        r = read_bucket_policy(store->ctl.user, s, bucket_info, bucket_attrs, bucket_acl,
                                bucket);
         if (r < 0) {
           ldpp_dout(this, 0) << "failed to read bucket ACL for bucket "
@@ -2297,7 +2297,7 @@ void RGWListBuckets::execute()
   }
 
   if (supports_account_metadata()) {
-    op_ret = rgw_get_user_attrs_by_uid(store, s->user->user_id, attrs);
+    op_ret = store->ctl.user->get_attrs_by_uid(s->user->user_id, &attrs);
     if (op_ret < 0) {
       goto send_end;
     }
@@ -3117,7 +3117,7 @@ void RGWCreateBucket::execute()
   s->bucket_owner.set_id(s->user->user_id);
   s->bucket_owner.set_name(s->user->display_name);
   if (s->bucket_exists) {
-    int r = rgw_op_get_bucket_policy_from_attr(s->cct, store, s->bucket_info,
+    int r = rgw_op_get_bucket_policy_from_attr(s->cct, store->ctl.user, s->bucket_info,
                                                s->bucket_attrs, &old_policy);
     if (r >= 0)  {
       if (old_policy.get_owner().get_id().compare(s->user->user_id) != 0) {
@@ -3372,7 +3372,7 @@ void RGWDeleteBucket::execute()
     }
   }
 
-  op_ret = rgw_bucket_sync_user_stats(store, s->user->user_id, s->bucket_info);
+  op_ret = store->ctl.bucket->sync_user_stats(s->user->user_id, s->bucket_info);
   if ( op_ret < 0) {
      ldpp_dout(this, 1) << "WARNING: failed to sync user stats before bucket delete: op_ret= " << op_ret << dendl;
   }
@@ -4322,8 +4322,8 @@ int RGWPutMetadataAccount::init_processing()
     return op_ret;
   }
 
-  op_ret = rgw_get_user_attrs_by_uid(store, s->user->user_id, orig_attrs,
-                                     &acct_op_tracker);
+  op_ret = store->ctl.user->get_attrs_by_uid(s->user->user_id, &orig_attrs,
+                                             &acct_op_tracker);
   if (op_ret < 0) {
     return op_ret;
   }
@@ -4384,8 +4384,9 @@ void RGWPutMetadataAccount::execute()
 {
   /* Params have been extracted earlier. See init_processing(). */
   RGWUserInfo new_uinfo;
-  op_ret = rgw_get_user_info_by_uid(store, s->user->user_id, new_uinfo,
-                                    &acct_op_tracker);
+  op_ret = store->ctl.user->get_info_by_uid(s->user->user_id, new_uinfo,
+                                            RGWUserCtl::GetParams()
+                                            .set_objv_tracker(&acct_op_tracker));
   if (op_ret < 0) {
     return;
   }
@@ -4404,8 +4405,10 @@ void RGWPutMetadataAccount::execute()
 
   /* We are passing here the current (old) user info to allow the function
    * optimize-out some operations. */
-  op_ret = rgw_store_user_info(store, new_uinfo, s->user,
-                               &acct_op_tracker, real_time(), false, &attrs);
+  op_ret = store->ctl.user->store_info(new_uinfo, RGWCtl::PutParams()
+                                                  .set_old_info(s->user),
+                                                  .set_objv_tracker(&acct_op_tracker)
+                                                  .set_attrs(&attrs));
 }
 
 int RGWPutMetadataBucket::verify_permission()
@@ -4954,7 +4957,7 @@ int RGWCopyObj::verify_permission()
   store->set_atomic(s->obj_ctx, dest_obj);
 
   /* check dest bucket permissions */
-  op_ret = read_bucket_policy(store, s, dest_bucket_info, dest_attrs,
+  op_ret = read_bucket_policy(store->ctl.user, s, dest_bucket_info, dest_attrs,
                               &dest_bucket_policy, dest_bucket);
   if (op_ret < 0) {
     return op_ret;
@@ -5337,7 +5340,7 @@ void RGWPutACLs::execute()
     *_dout << dendl;
   }
 
-  op_ret = policy->rebuild(store, &owner, new_policy);
+  op_ret = policy->rebuild(store->ctl.user, &owner, new_policy);
   if (op_ret < 0)
     return;
 
@@ -6452,7 +6455,7 @@ bool RGWBulkDelete::Deleter::verify_permission(RGWBucketInfo& binfo,
                                                ACLOwner& bucket_owner /* out */)
 {
   RGWAccessControlPolicy bacl(store->ctx());
-  int ret = read_bucket_policy(store, s, binfo, battrs, &bacl, binfo.bucket);
+  int ret = read_bucket_policy(store->ctl.user, s, binfo, battrs, &bacl, binfo.bucket);
   if (ret < 0) {
     return false;
   }
@@ -6769,7 +6772,7 @@ int RGWBulkUploadOp::handle_dir(const boost::string_ref path)
 
   if (bucket_exists) {
     RGWAccessControlPolicy old_policy(s->cct);
-    int r = rgw_op_get_bucket_policy_from_attr(s->cct, store, binfo,
+    int r = rgw_op_get_bucket_policy_from_attr(s->cct, store->ctl.user, binfo,
                                                battrs, &old_policy);
     if (r >= 0)  {
       if (old_policy.get_owner().get_id().compare(s->user->user_id) != 0) {
@@ -6902,7 +6905,7 @@ bool RGWBulkUploadOp::handle_file_verify_permission(RGWBucketInfo& binfo,
                                                     ACLOwner& bucket_owner /* out */)
 {
   RGWAccessControlPolicy bacl(store->ctx());
-  op_ret = read_bucket_policy(store, s, binfo, battrs, &bacl, binfo.bucket);
+  op_ret = read_bucket_policy(store->ctl.user, s, binfo, battrs, &bacl, binfo.bucket);
   if (op_ret < 0) {
     ldpp_dout(this, 20) << "cannot read_policy() for bucket" << dendl;
     return false;
index 5ca5635fb4de4006dc7cc32df2e8b8ca16b2665f..73872a18b920623c34d3aed5c5a4e363ccc90d4c 100644 (file)
@@ -183,7 +183,7 @@ void RGWUserPubSub::get_sub_meta_obj(const string& name, rgw_raw_obj *obj) const
 
 int RGWUserPubSub::remove(const rgw_raw_obj& obj, RGWObjVersionTracker *objv_tracker)
 {
-  int ret = rgw_delete_system_obj(store, obj.pool, obj.oid, objv_tracker);
+  int ret = rgw_delete_system_obj(store->svc.sysobj, obj.pool, obj.oid, objv_tracker);
   if (ret < 0) {
     return ret;
   }
index a2196313a5ebb9820b2d9cee8dfab89391adc9a8..f55b9bff23823356122198cc988e91ff487b21ec 100644 (file)
@@ -616,7 +616,7 @@ public:
 
 int RGWUserStatsCache::fetch_stats_from_storage(const rgw_user& user, const rgw_bucket& bucket, RGWStorageStats& stats)
 {
-  int r = store->get_user_stats(user, stats);
+  int r = store->ctl.user->get_user_stats(user, stats);
   if (r < 0) {
     ldout(store->ctx(), 0) << "could not get user stats for user=" << user << dendl;
     return r;
index 15f1a1478b53bb77122fc611cac4f56028727f1e..010eb237671a72e620fe62218efab9dda627223c 100644 (file)
@@ -81,6 +81,7 @@ using namespace librados;
 #include "services/svc_sys_obj.h"
 #include "services/svc_sys_obj_cache.h"
 #include "services/svc_bucket.h"
+#include "services/svc_mdlog.h"
 
 #include "compressor/Compressor.h"
 
@@ -832,7 +833,7 @@ int RGWIndexCompletionThread::process()
                               cls_rgw_guard_bucket_resharding(o, -ERR_BUSY_RESHARDING);
                               cls_rgw_bucket_complete_op(o, c->op, c->tag, c->ver, c->key, c->dir_meta, &c->remove_objs,
                                                          c->log_op, c->bilog_op, &c->zones_trace);
-                              return bs->index_ctx.operate(bs->bucket_obj, &o);
+                              return bs->bucket_obj.operate(&o, null_yield);
                              });
     if (r < 0) {
       ldout(cct, 0) << "ERROR: " << __func__ << "(): bucket index completion failed, obj=" << c->obj << " r=" << r << dendl;
@@ -1191,25 +1192,10 @@ int RGWRados::init_complete()
 
   /* no point of running sync thread if we don't have a master zone configured
     or there is no rest_master_conn */
-  if (zonegroup.master_zone.empty() || !svc.zone->get_master_conn()
-      || current_period.get_id().empty()) {
-    run_sync_thread = false;
-  }
-
-  if (run_sync_thread) {
-    // initialize the log period history
-    ctl.meta.mgr->init_oldest_log_period();
-  }
-
-  ret = ctl.meta.mgr->init(current_period.get_id());
-  if (ret < 0) {
-    lderr(cct) << "ERROR: failed to initialize metadata log: "
-        << cpp_strerror(-ret) << dendl;
-    return ret;
-  }
+  run_sync_thread = !svc.zone->need_to_sync();
 
   if (svc.zone->is_meta_master()) {
-    auto md_log = ctl.meta.mgr->get_log(current_period.get_id());
+    auto md_log = svc.mdlog->get_log(current_period.get_id());
     meta_notifier = new RGWMetaNotifier(this, md_log);
     meta_notifier->start();
   }
@@ -1232,7 +1218,7 @@ int RGWRados::init_complete()
     }
     auto async_processor = svc.rados->get_async_processor();
     Mutex::Locker l(meta_sync_thread_lock);
-    meta_sync_processor_thread = new RGWMetaSyncProcessorThread(this, async_rados);
+    meta_sync_processor_thread = new RGWMetaSyncProcessorThread(this, async_processor);
     ret = meta_sync_processor_thread->init();
     if (ret < 0) {
       ldout(cct, 0) << "ERROR: failed to initialize meta sync thread" << dendl;
@@ -1255,7 +1241,7 @@ int RGWRados::init_complete()
     Mutex::Locker dl(data_sync_thread_lock);
     for (auto source_zone : svc.zone->get_data_sync_source_zones()) {
       ldout(cct, 5) << "starting data sync thread for zone " << source_zone->name << dendl;
-      auto *thread = new RGWDataSyncProcessorThread(this, async_rados, source_zone);
+      auto *thread = new RGWDataSyncProcessorThread(this, svc.rados->get_async_processor(), source_zone);
       ret = thread->init();
       if (ret < 0) {
         ldout(cct, 0) << "ERROR: failed to initialize data sync thread" << dendl;
@@ -1331,7 +1317,7 @@ int RGWRados::init_svc(bool raw)
 
 int RGWRados::init_ctl()
 {
-  return ctl.init(svc);
+  return ctl.init(&svc);
 }
 
 /** 
@@ -2145,19 +2131,13 @@ int RGWRados::create_bucket(const RGWUserInfo& owner, rgw_bucket& bucket,
       info.quota = *pquota_info;
     }
 
-    int r = init_bucket_index(info, info.num_shards);
+    int r = svc.bi->init_index(info);
     if (r < 0) {
       return r;
     }
 
     ret = put_linked_bucket_info(info, exclusive, ceph::real_time(), pep_objv, &attrs, true);
     if (ret == -EEXIST) {
-      librados::IoCtx index_ctx;
-      map<int, string> bucket_objs;
-      int r = open_bucket_index(info, index_ctx, bucket_objs);
-      if (r < 0)
-        return r;
-
        /* we need to reread the info and return it, caller will have a use for it */
       RGWObjVersionTracker instance_ver = info.objv_tracker;
       info.objv_tracker.clear();
@@ -2173,17 +2153,10 @@ int RGWRados::create_bucket(const RGWUserInfo& owner, rgw_bucket& bucket,
 
       /* only remove it if it's a different bucket instance */
       if (info.bucket.bucket_id != bucket.bucket_id) {
-        /* remove bucket meta instance */
-        r = rgw_bucket_instance_remove_entry(this,
-                                            bucket.get_key(),
-                                            &instance_ver);
-        if (r < 0)
-          return r;
-
-       /* remove bucket index objects asynchronously by best effort */
-       (void) CLSRGWIssueBucketIndexClean(index_ctx,
-                                          bucket_objs,
-                                          cct->_conf->rgw_bucket_index_max_aio)();
+       int r = svc.bi->clean_index(info);
+        if (r < 0) {
+         ldout(cct, 0) << "WARNING: could not remove bucket index (r=" << r << ")" << dendl;
+       }
       }
       /* ret == -ENOENT here */
     }
@@ -2238,12 +2211,16 @@ int RGWRados::get_obj_head_ref(const RGWBucketInfo& bucket_info, const rgw_obj&
     return -EIO;
   }
 
-  int r = open_pool_ctx(pool, ref->ioctx, false);
+  ref->pool = svc.rados->pool(pool);
+
+  int r = ref->pool.open(RGWSI_RADOS::Pool::OpenParams()
+                         .set_mostly_omap(false);
   if (r < 0) {
+    ldout(cct, 0) << "ERROR: failed opening data pool (pool=" << pool << "); r=" << r << dendl;
     return r;
   }
 
-  ref->ioctx.locator_set_key(ref->obj.loc);
+  ref->pool.ioctx().locator_set_key(ref->obj.loc);
 
   return 0;
 }
@@ -2258,11 +2235,15 @@ int RGWRados::get_raw_obj_ref(const rgw_raw_obj& obj, rgw_rados_ref *ref)
     ref->obj.oid = obj.pool.to_str();
     ref->obj.pool = svc.zone->get_zone_params().domain_root;
   }
-  r = open_pool_ctx(ref->obj.pool, ref->ioctx, false);
-  if (r < 0)
+  ref->pool = svc.rados->pool(obj.pool);
+  int r = ref->pool.open(RGWSI_RADOS::Pool::OpenParams()
+                         .set_mostly_omap(false);
+  if (r < 0) {
+    ldout(cct, 0) << "ERROR: failed opening pool (pool=" << obj.pool << "); r=" << r << dendl;
     return r;
+  }
 
-  ref->ioctx.locator_set_key(ref->obj.loc);
+  ref->pool.ioctx().locator_set_key(ref->obj.loc);
 
   return 0;
 }
@@ -2469,12 +2450,14 @@ int RGWRados::fix_tail_obj_locator(const RGWBucketInfo& bucket_info, rgw_obj_key
        continue;
       }
 
+      auto& ioctx = ref.pool.ioctx();
+
       get_obj_bucket_and_oid_loc(loc, oid, locator);
-      ref.ioctx.locator_set_key(locator);
+      ref.pool.ioctx().locator_set_key(locator);
 
       ldout(cct, 20) << __func__ << ": key=" << key << " oid=" << oid << " locator=" << locator << dendl;
 
-      r = ref.ioctx.stat(oid, NULL, NULL);
+      r = ioctx.stat(oid, NULL, NULL);
       if (r != -ENOENT) {
        continue;
       }
@@ -2484,7 +2467,7 @@ int RGWRados::fix_tail_obj_locator(const RGWBucketInfo& bucket_info, rgw_obj_key
 
       /* create a new ioctx with the bad locator */
       librados::IoCtx src_ioctx;
-      src_ioctx.dup(ref.ioctx);
+      src_ioctx.dup(ioctx);
       src_ioctx.locator_set_key(bad_loc);
 
       r = src_ioctx.stat(oid, NULL, NULL);
@@ -2497,7 +2480,7 @@ int RGWRados::fix_tail_obj_locator(const RGWBucketInfo& bucket_info, rgw_obj_key
         *need_fix = true;
       }
       if (fix) {
-        r = move_rados_obj(src_ioctx, oid, bad_loc, ref.ioctx, oid, locator);
+        r = move_rados_obj(src_ioctx, oid, bad_loc, ioctx, oid, locator);
         if (r < 0) {
           lderr(cct) << "ERROR: copy_rados_obj() on oid=" << oid << " returned r=" << r << dendl;
         }
@@ -2525,12 +2508,14 @@ int RGWRados::BucketShard::init(const rgw_bucket& _bucket,
     return ret;
   }
 
-  ret = store->open_bucket_index_shard(*bucket_info_p, index_ctx, obj.get_hash_object(), &bucket_obj, &shard_id);
+  string oid;
+
+  ret = store->svc.bi_rados->open_bucket_index_shard(*bucket_info_p, obj.get_hash_object(), &bucket_obj, &shard_id);
   if (ret < 0) {
     ldout(store->ctx(), 0) << "ERROR: open_bucket_index_shard() returned ret=" << ret << dendl;
     return ret;
   }
-  ldout(store->ctx(), 20) << " bucket index object: " << bucket_obj << dendl;
+  ldout(store->ctx(), 20) << " bucket index object: " << bucket_obj.get_raw_obj() << dendl;
 
   return 0;
 }
@@ -2552,12 +2537,14 @@ int RGWRados::BucketShard::init(const rgw_bucket& _bucket,
     return ret;
   }
 
-  ret = store->open_bucket_index_shard(*bucket_info_p, index_ctx, shard_id, &bucket_obj);
+  string oid;
+
+  ret = store->svc.bi_rados->open_bucket_index_shard(*bucket_info_p, shard_id, &bucket_obj);
   if (ret < 0) {
     ldout(store->ctx(), 0) << "ERROR: open_bucket_index_shard() returned ret=" << ret << dendl;
     return ret;
   }
-  ldout(store->ctx(), 20) << " bucket index object: " << bucket_obj << dendl;
+  ldout(store->ctx(), 20) << " bucket index oid: " << bucket_obj.get_raw_obj() << dendl;
 
   return 0;
 }
@@ -2567,9 +2554,10 @@ int RGWRados::BucketShard::init(const RGWBucketInfo& bucket_info,
 {
   bucket = bucket_info.bucket;
 
-  int ret = store->open_bucket_index_shard(bucket_info, index_ctx,
-                                           obj.get_hash_object(), &bucket_obj,
-                                           &shard_id);
+  int ret = store->svc.bi_rados->open_bucket_index_shard(bucket_info,
+                                                        obj.get_hash_object(),
+                                                        &bucket_obj,
+                                                        &shard_id);
   if (ret < 0) {
     ldout(store->ctx(), 0) << "ERROR: open_bucket_index_shard() returned ret=" << ret << dendl;
     return ret;
@@ -2584,7 +2572,7 @@ int RGWRados::BucketShard::init(const RGWBucketInfo& bucket_info, int sid)
   bucket = bucket_info.bucket;
   shard_id = sid;
 
-  int ret = store->open_bucket_index_shard(bucket_info, index_ctx, shard_id, &bucket_obj);
+  int ret = store->svc.bi_rados->open_bucket_index_shard(bucket_info, shard_id, &bucket_obj);
   if (ret < 0) {
     ldout(store->ctx(), 0) << "ERROR: open_bucket_index_shard() returned ret=" << ret << dendl;
     return ret;
@@ -3016,8 +3004,10 @@ int RGWRados::Object::Write::_do_write_meta(uint64_t size, uint64_t accounted_si
       return r;
   }
 
+  auto& ioctx = ref.pool.ioctx();
+
   tracepoint(rgw_rados, operate_enter, req_id.c_str());
-  r = ref.ioctx.operate(ref.obj.oid, &op);
+  r = ioctx.operate(ref.obj.oid, &op);
   tracepoint(rgw_rados, operate_exit, req_id.c_str());
   if (r < 0) { /* we can expect to get -ECANCELED if object was replaced under,
                 or -ENOENT if was removed, or -EEXIST if it did not exist
@@ -3029,8 +3019,8 @@ int RGWRados::Object::Write::_do_write_meta(uint64_t size, uint64_t accounted_si
     goto done_cancel;
   }
 
-  epoch = ref.ioctx.get_last_version();
-  poolid = ref.ioctx.get_id();
+  epoch = ioctx.get_last_version();
+  poolid = ioctx.get_id();
 
   r = target->complete_atomic_modification();
   if (r < 0) {
@@ -4107,9 +4097,11 @@ int RGWRados::copy_obj(RGWObjectCtx& obj_ctx,
       ref_tag = tag + '\0';
       cls_refcount_get(op, ref_tag, true);
       const rgw_raw_obj& loc = miter.get_location().get_raw_obj(this);
-      ref.ioctx.locator_set_key(loc.loc);
 
-      ret = ref.ioctx.operate(loc.oid, &op);
+      auto& ioctx = ref.pool.ioctx();
+      ioctx.locator_set_key(loc.loc);
+
+      ret = ioctx.operate(loc.oid, &op);
       if (ret < 0) {
         goto done_ret;
       }
@@ -4162,9 +4154,9 @@ done_ret:
       ObjectWriteOperation op;
       cls_refcount_put(op, tag, true);
 
-      ref.ioctx.locator_set_key(riter->loc);
+      ref.pool.ioctx().locator_set_key(riter->loc);
 
-      int r = ref.ioctx.operate(riter->oid, &op);
+      int r = ref.pool.ioctx().operate(riter->oid, &op);
       if (r < 0) {
         ldpp_dout(dpp, 0) << "ERROR: cleanup after error failed to drop reference on obj=" << *riter << dendl;
       }
@@ -4347,9 +4339,9 @@ int RGWRados::check_bucket_empty(RGWBucketInfo& bucket_info, optional_yield y)
 int RGWRados::delete_bucket(RGWBucketInfo& bucket_info, RGWObjVersionTracker& objv_tracker, optional_yield y, bool check_empty)
 {
   const rgw_bucket& bucket = bucket_info.bucket;
-  librados::IoCtx index_ctx;
+  RGWSI_RADOS::Pool index_pool;
   map<int, string> bucket_objs;
-  int r = open_bucket_index(bucket_info, index_ctx, bucket_objs);
+  int r = svc.bi_rados->open_bucket_index(bucket_info, std::nullopt, &index_pool, &bucket_objs, nullptr);
   if (r < 0)
     return r;
   
@@ -4360,20 +4352,22 @@ int RGWRados::delete_bucket(RGWBucketInfo& bucket_info, RGWObjVersionTracker& ob
     }
   }
   
-  r = rgw_bucket_delete_bucket_obj(this, bucket.tenant, bucket.name, objv_tracker);
+  r = ctl.bucket->remove_bucket_entrypoint_info(bucket_info.bucket,
+                                               RGWBucketCtl::Bucket::RemoveParams()
+                                               .set_objv_tracker(&objv_tracker));
   if (r < 0)
     return r;
 
   /* if the bucket is not synced we can remove the meta file */
   if (!svc.zone->is_syncing_bucket_meta(bucket)) {
     RGWObjVersionTracker objv_tracker;
-    r = rgw_bucket_instance_remove_entry(this, bucket.get_key(), &objv_tracker);
+    r = ctl.bucket->remove_bucket_instance_info(bucket, bucket_info);
     if (r < 0) {
       return r;
     }
 
    /* remove bucket index objects asynchronously by best effort */
-    (void) CLSRGWIssueBucketIndexClean(index_ctx,
+    (void) CLSRGWIssueBucketIndexClean(index_pool.ioctx(),
                                       bucket_objs,
                                       cct->_conf->rgw_bucket_index_max_aio)();
   }
@@ -4516,18 +4510,22 @@ int RGWRados::bucket_check_index(RGWBucketInfo& bucket_info,
                                 map<RGWObjCategory, RGWStorageStats> *existing_stats,
                                 map<RGWObjCategory, RGWStorageStats> *calculated_stats)
 {
-  librados::IoCtx index_ctx;
+  RGWSI_RADOS::Pool index_pool;
   // key - bucket index object id
   // value - bucket index check OP returned result with the given bucket index object (shard)
   map<int, string> oids;
   map<int, struct rgw_cls_check_index_ret> bucket_objs_ret;
 
-  int ret = open_bucket_index_map(bucket_info, index_ctx, oids, bucket_objs_ret);
+  int ret = svc.bi_rados->open_bucket_index(bucket_info, std::nullopt, &index_pool, &oids, nullptr);
   if (ret < 0) {
       return ret;
   }
 
-  ret = CLSRGWIssueBucketCheck(index_ctx, oids, bucket_objs_ret, cct->_conf->rgw_bucket_index_max_aio)();
+  for (auto& iter : oids) {
+    bucket_objs_ret[iter.first] = rgw_cls_check_index_ret();
+  }
+
+  ret = CLSRGWIssueBucketCheck(index_pool.ioctx(), oids, bucket_objs_ret, cct->_conf->rgw_bucket_index_max_aio)();
   if (ret < 0) {
       return ret;
   }
@@ -4544,28 +4542,28 @@ int RGWRados::bucket_check_index(RGWBucketInfo& bucket_info,
 
 int RGWRados::bucket_rebuild_index(RGWBucketInfo& bucket_info)
 {
-  librados::IoCtx index_ctx;
+  RGWSI_RADOS::Pool index_pool;
   map<int, string> bucket_objs;
 
-  int r = open_bucket_index(bucket_info, index_ctx, bucket_objs);
+  int r = svc.bi_rados->open_bucket_index(bucket_info, std::nullopt, &index_pool, &bucket_objs, nullptr);
   if (r < 0) {
     return r;
   }
 
-  return CLSRGWIssueBucketRebuild(index_ctx, bucket_objs, cct->_conf->rgw_bucket_index_max_aio)();
+  return CLSRGWIssueBucketRebuild(index_pool.ioctx(), bucket_objs, cct->_conf->rgw_bucket_index_max_aio)();
 }
 
 int RGWRados::bucket_set_reshard(const RGWBucketInfo& bucket_info, const cls_rgw_bucket_instance_entry& entry)
 {
-  librados::IoCtx index_ctx;
+  RGWSI_RADOS::Pool index_pool;
   map<int, string> bucket_objs;
 
-  int r = open_bucket_index(bucket_info, index_ctx, bucket_objs);
+  int r = svc.bi_rados->open_bucket_index(bucket_info, std::nullopt, &index_pool, &bucket_objs, nullptr);
   if (r < 0) {
     return r;
   }
 
-  return CLSRGWIssueSetBucketResharding(index_ctx, bucket_objs, entry, cct->_conf->rgw_bucket_index_max_aio)();
+  return CLSRGWIssueSetBucketResharding(index_pool.ioctx(), bucket_objs, entry, cct->_conf->rgw_bucket_index_max_aio)();
 }
 
 int RGWRados::defer_gc(void *ctx, const RGWBucketInfo& bucket_info, const rgw_obj& obj, optional_yield y)
@@ -4800,19 +4798,21 @@ int RGWRados::Object::Delete::delete_obj(optional_yield y)
     return r;
 
   store->remove_rgw_head_obj(op);
-  r = ref.ioctx.operate(ref.obj.oid, &op);
+
+  auto& ioctx = ref.pool.ioctx();
+  r = ioctx.operate(ref.obj.oid, &op);
 
   /* raced with another operation, object state is indeterminate */
   const bool need_invalidate = (r == -ECANCELED);
 
-  int64_t poolid = ref.ioctx.get_id();
+  int64_t poolid = ioctx.get_id();
   if (r >= 0) {
     tombstone_cache_t *obj_tombstone_cache = store->get_tombstone_cache();
     if (obj_tombstone_cache) {
       tombstone_entry entry{*state};
       obj_tombstone_cache->add(obj, entry);
     }
-    r = index_op.complete_del(poolid, ref.ioctx.get_last_version(), state->mtime, params.remove_objs);
+    r = index_op.complete_del(poolid, ioctx.get_last_version(), state->mtime, params.remove_objs);
     
     int ret = target->complete_atomic_modification();
     if (ret < 0) {
@@ -4870,7 +4870,7 @@ int RGWRados::delete_raw_obj(const rgw_raw_obj& obj)
   ObjectWriteOperation op;
 
   op.remove();
-  r = ref.ioctx.operate(ref.obj.oid, &op);
+  r = ref.pool.ioctx().operate(ref.obj.oid, &op);
   if (r < 0)
     return r;
 
@@ -5492,7 +5492,8 @@ int RGWRados::set_attrs(void *ctx, const RGWBucketInfo& bucket_info, rgw_obj& sr
   real_time mtime = real_clock::now();
   struct timespec mtime_ts = real_clock::to_timespec(mtime);
   op.mtime2(&mtime_ts);
-  r = ref.ioctx.operate(ref.obj.oid, &op);
+  auto& ioctx = ref.pool.ioctx();
+  r = ioctx.operate(ref.obj.oid, &op);
   if (state) {
     if (r >= 0) {
       bufferlist acl_bl = attrs[RGW_ATTR_ACL];
@@ -5505,8 +5506,8 @@ int RGWRados::set_attrs(void *ctx, const RGWBucketInfo& bucket_info, rgw_obj& sr
       if (iter != attrs.end()) {
         storage_class = rgw_bl_str(iter->second);
       }
-      uint64_t epoch = ref.ioctx.get_last_version();
-      int64_t poolid = ref.ioctx.get_id();
+      uint64_t epoch = ioctx.get_last_version();
+      int64_t poolid = ioctx.get_id();
       r = index_op.complete(poolid, epoch, state->size, state->accounted_size,
                             mtime, etag, content_type, storage_class, &acl_bl,
                             RGWObjCategory::Main, NULL);
@@ -6171,7 +6172,7 @@ int RGWRados::obj_operate(const RGWBucketInfo& bucket_info, const rgw_obj& obj,
     return r;
   }
 
-  return ref.ioctx.operate(ref.obj.oid, op);
+  return ref.pool.ioctx().operate(ref.obj.oid, op);
 }
 
 int RGWRados::obj_operate(const RGWBucketInfo& bucket_info, const rgw_obj& obj, ObjectReadOperation *op)
@@ -6184,7 +6185,7 @@ int RGWRados::obj_operate(const RGWBucketInfo& bucket_info, const rgw_obj& obj,
 
   bufferlist outbl;
 
-  return ref.ioctx.operate(ref.obj.oid, op, &outbl);
+  return ref.pool.ioctx().operate(ref.obj.oid, op, &outbl);
 }
 
 int RGWRados::olh_init_modification_impl(const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& olh_obj, string *op_tag)
@@ -6364,7 +6365,8 @@ int RGWRados::block_while_resharding(RGWRados::BucketShard *bs,
 
   constexpr int num_retries = 10;
   for (int i = 1; i <= num_retries; i++) { // nb: 1-based for loop
-    ret = cls_rgw_get_bucket_resharding(bs->index_ctx, bs->bucket_obj, &entry);
+    auto& ref = bs->bucket_obj.get_ref();
+    ret = cls_rgw_get_bucket_resharding(ref.pool.ioctx(), ref.obj.oid, &entry);
     if (ret == -ENOENT) {
       return fetch_new_bucket_id("get_bucket_resharding_failed", new_bucket_id);
     } else if (ret < 0) {
@@ -6458,13 +6460,14 @@ int RGWRados::bucket_index_link_olh(const RGWBucketInfo& bucket_info, RGWObjStat
 
   BucketShard bs(this);
 
-  cls_rgw_obj_key key(obj_instance.key.get_index_key_name(), obj_instance.key.instance);
   r = guard_reshard(&bs, obj_instance, bucket_info,
                    [&](BucketShard *bs) -> int {
+                     cls_rgw_obj_key key(obj_instance.key.get_index_key_name(), obj_instance.key.instance);
+                     auto& ref = bs->bucket_obj.get_ref();
                      librados::ObjectWriteOperation op;
                      cls_rgw_guard_bucket_resharding(op, -ERR_BUSY_RESHARDING);
-                     return cls_rgw_bucket_link_olh(bs->index_ctx, op,
-                                                    bs->bucket_obj, key, olh_state.olh_tag, delete_marker, op_tag, meta, olh_epoch,
+                     return cls_rgw_bucket_link_olh(ref.pool.ioctx(), op,
+                                                    ref.obj.oid, key, olh_state.olh_tag, delete_marker, op_tag, meta, olh_epoch,
                                                     unmod_since, high_precision_time,
                                                     svc.zone->get_zone().log_data, zones_trace);
                     });
@@ -6506,9 +6509,10 @@ int RGWRados::bucket_index_unlink_instance(const RGWBucketInfo& bucket_info, con
   cls_rgw_obj_key key(obj_instance.key.get_index_key_name(), obj_instance.key.instance);
   r = guard_reshard(&bs, obj_instance, bucket_info,
                    [&](BucketShard *bs) -> int {
+                     auto& ref = bs->bucket_obj.get_ref();
                      librados::ObjectWriteOperation op;
                      cls_rgw_guard_bucket_resharding(op, -ERR_BUSY_RESHARDING);
-                     return cls_rgw_bucket_unlink_instance(bs->index_ctx, op, bs->bucket_obj, key, op_tag,
+                     return cls_rgw_bucket_unlink_instance(ref.pool.ioctx(), op, ref.obj.oid, key, op_tag,
                                                            olh_tag, olh_epoch, svc.zone->get_zone().log_data, zones_trace);
                     });
   if (r < 0) {
@@ -6544,9 +6548,10 @@ int RGWRados::bucket_index_read_olh_log(const RGWBucketInfo& bucket_info, RGWObj
 
   ret = guard_reshard(&bs, obj_instance, bucket_info,
                      [&](BucketShard *bs) -> int {
+                       auto& ref = bs->bucket_obj.get_ref();
                        ObjectReadOperation op;
                        cls_rgw_guard_bucket_resharding(op, -ERR_BUSY_RESHARDING);
-                       return cls_rgw_get_olh_log(bs->index_ctx, bs->bucket_obj, op,
+                       return cls_rgw_get_olh_log(ref.pool.ioctx(), ref.obj.oid, op,
                                                   key, ver_marker, olh_tag, log, is_truncated);
                      });
   if (ret < 0) {
@@ -6603,7 +6608,7 @@ int RGWRados::repair_olh(RGWObjState* state, const RGWBucketInfo& bucket_info,
   if (r < 0) {
     return r;
   }
-  r = ref.ioctx.operate(ref.obj.oid, &op);
+  r = ref.pool.ioctx().operate(ref.obj.oid, &op);
   if (r < 0) {
     ldout(cct, 0) << "repair_olh failed to write olh attributes with "
         << cpp_strerror(r) << dendl;
@@ -6637,7 +6642,7 @@ int RGWRados::bucket_index_trim_olh_log(const RGWBucketInfo& bucket_info, RGWObj
                        ObjectWriteOperation op;
                        cls_rgw_guard_bucket_resharding(op, -ERR_BUSY_RESHARDING);
                        cls_rgw_trim_olh_log(op, key, ver, olh_tag);
-                       return pbs->index_ctx.operate(pbs->bucket_obj, &op);
+                       return pbs->bucket_obj.operate(&op, null_yield);
                       });
   if (ret < 0) {
     ldout(cct, 20) << "cls_rgw_trim_olh_log() returned r=" << ret << dendl;
@@ -6664,8 +6669,9 @@ int RGWRados::bucket_index_clear_olh(const RGWBucketInfo& bucket_info, RGWObjSta
   int ret = guard_reshard(&bs, obj_instance, bucket_info,
                          [&](BucketShard *pbs) -> int {
                            ObjectWriteOperation op;
+                           auto& ref = pbs->bucket_obj.get_ref();
                            cls_rgw_guard_bucket_resharding(op, -ERR_BUSY_RESHARDING);
-                           return cls_rgw_clear_olh(pbs->index_ctx, op, pbs->bucket_obj, key, olh_tag);
+                           return cls_rgw_clear_olh(ref.pool.ioctx(), op, ref.obj.oid, key, olh_tag);
                           });
   if (ret < 0) {
     ldout(cct, 5) << "cls_rgw_clear_olh() returned ret=" << ret << dendl;
@@ -6770,7 +6776,7 @@ int RGWRados::apply_olh_log(RGWObjectCtx& obj_ctx, RGWObjState& state, const RGW
   }
 
   /* update olh object */
-  r = ref.ioctx.operate(ref.obj.oid, &op);
+  r = ref.pool.ioctx().operate(ref.obj.oid, &op);
   if (r == -ECANCELED) {
     r = 0;
   }
@@ -6793,7 +6799,7 @@ int RGWRados::apply_olh_log(RGWObjectCtx& obj_ctx, RGWObjState& state, const RGW
     cls_obj_check_prefix_exist(rm_op, RGW_ATTR_OLH_PENDING_PREFIX, true); /* fail if found one of these, pending modification */
     rm_op.remove();
 
-    r = ref.ioctx.operate(ref.obj.oid, &rm_op);
+    r = ref.pool.ioctx().operate(ref.obj.oid, &rm_op);
     if (r == -ECANCELED) {
       return 0; /* someone else won this race */
     } else {
@@ -7064,7 +7070,7 @@ int RGWRados::remove_olh_pending_entries(const RGWBucketInfo& bucket_info, RGWOb
       op.rmxattr(i->first.c_str());
     }
 
-    r = ref.ioctx.operate(ref.obj.oid, &op);
+    r = ref.pool.ioctx().operate(ref.obj.oid, &op);
     if (r == -ENOENT || r == -ECANCELED) {
       /* raced with some other change, shouldn't sweat about it */
       return 0;
@@ -7150,10 +7156,10 @@ int RGWRados::raw_obj_stat(rgw_raw_obj& obj, uint64_t *psize, real_time *pmtime,
   }
   bufferlist outbl;
 
-  r = rgw_rados_operate(ref.ioctx, ref.obj.oid, &op, &outbl, y);
+  r = rgw_rados_operate(ref.pool.ioctx(), ref.obj.oid, &op, &outbl, y);
 
   if (epoch) {
-    *epoch = ref.ioctx.get_last_version();
+    *epoch = ref.pool.ioctx().get_last_version();
   }
 
   if (r < 0)
@@ -7290,24 +7296,6 @@ public:
   }
 };
 
-int RGWRados::get_user_stats(const rgw_user& user, RGWStorageStats& stats)
-{
-  string user_str = user.to_str();
-
-  cls_user_header header;
-  int r = cls_user_get_header(user_str, &header);
-  if (r < 0)
-    return r;
-
-  const cls_user_stats& hs = header.stats;
-
-  stats.size = hs.total_bytes;
-  stats.size_rounded = hs.total_bytes_rounded;
-  stats.num_objects = hs.total_entries;
-
-  return 0;
-}
-
 int RGWRados::get_user_stats_async(const rgw_user& user, RGWGetUserStats_CB *ctx)
 {
   string user_str = user.to_str();
@@ -7323,22 +7311,6 @@ int RGWRados::get_user_stats_async(const rgw_user& user, RGWGetUserStats_CB *ctx
   return 0;
 }
 
-void RGWRados::get_bucket_meta_oid(const rgw_bucket& bucket, string& oid)
-{
-  oid = RGW_BUCKET_INSTANCE_MD_PREFIX + bucket.get_key(':');
-}
-
-void RGWRados::get_bucket_instance_obj(const rgw_bucket& bucket, rgw_raw_obj& obj)
-{
-  if (!bucket.oid.empty()) {
-    obj.init(svc.zone->get_zone_params().domain_root, bucket.oid);
-  } else {
-    string oid;
-    get_bucket_meta_oid(bucket, oid);
-    obj.init(svc.zone->get_zone_params().domain_root, oid);
-  }
-}
-
 int RGWRados::get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const string& meta_key, RGWBucketInfo& info,
                                        real_time *pmtime, map<string, bufferlist> *pattrs, optional_yield y)
 {
@@ -7351,54 +7323,12 @@ int RGWRados::get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const string& m
 int RGWRados::get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const rgw_bucket& bucket, RGWBucketInfo& info,
                                        real_time *pmtime, map<string, bufferlist> *pattrs, optional_yield y)
 {
-  auto instance = svc.bucket->instance(obj_ctx, bucket);
-
-  int r = instance.get_op()
-    .set_mtime(pmtime)
-    .set_attrs(pattrs)
-    .set_pinfo(&info)
-    .set_yield(y)
-    .exec();
-
-  if (r < 0) {
-    return r;
-  }
-
-  return 0;
-}
-
-int RGWRados::get_bucket_entrypoint_info(RGWSysObjectCtx& obj_ctx,
-                                         const string& tenant_name,
-                                         const string& bucket_name,
-                                         RGWBucketEntryPoint& entry_point,
-                                         RGWObjVersionTracker *objv_tracker,
-                                         real_time *pmtime,
-                                         map<string, bufferlist> *pattrs,
-                                         rgw_cache_entry_info *cache_info,
-                                        boost::optional<obj_version> refresh_version)
-{
-#warning FIXME
-#if 0
-  bufferlist bl;
-  string bucket_entry;
-
-  rgw_make_bucket_entry_name(tenant_name, bucket_name, bucket_entry);
-  int ret = rgw_get_system_obj(obj_ctx, svc.zone->get_zone_params().domain_root,
-                              bucket_entry, bl, objv_tracker, pmtime, null_yield, pattrs,
-                              cache_info, refresh_version);
-  if (ret < 0) {
-    return ret;
-  }
-
-  auto iter = bl.cbegin();
-  try {
-    decode(entry_point, iter);
-  } catch (buffer::error& err) {
-    ldout(cct, 0) << "ERROR: could not decode buffer info, caught buffer::error" << dendl;
-    return -EIO;
-  }
-  return 0;
-#endif
+#warning need to pass obj_ctx
+  return ctl.bucket->read_bucket_instance_info(bucket, &info, y,
+                                              RGWBucketCtl::BucketInstance::GetParams()
+                                              .set_mtime(pmtime)
+                                              .set_attrs(pattrs)
+                                               .set_yield(y));
 }
 
 int RGWRados::get_bucket_info(RGWSysObjectCtx& obj_ctx,
@@ -7407,69 +7337,40 @@ int RGWRados::get_bucket_info(RGWSysObjectCtx& obj_ctx,
                               real_time *pmtime,
                               optional_yield y, map<string, bufferlist> *pattrs)
 {
-  auto instance = svc.bucket->instance(obj_ctx, tenant, bucket_name);
-
-  int r = instance.get_op()
-    .set_mtime(pmtime)
-    .set_attrs(pattrs)
-    .set_pinfo(&info)
-    .set_yield(y)
-    .exec();
-  if (r < 0) {
-    return r;
-  }
-
-  return 0;
+#warning need to pass obj_ctx
+  rgw_bucket bucket;
+  bucket.tenant = tenant;
+  bucket.name = bucket_name;
+  return ctl.bucket->read_bucket_info(bucket, &info, y,
+                                     RGWBucketCtl::BucketInstance::GetParams()
+                                     .set_mtime(pmtime)
+                                     .set_attrs(pattrs));
 }
 
 int RGWRados::try_refresh_bucket_info(RGWBucketInfo& info,
                                       ceph::real_time *pmtime,
                                       map<string, bufferlist> *pattrs)
 {
-  RGWSysObjectCtx obj_ctx = svc.sysobj->init_obj_ctx();
-  auto instance = svc.bucket->instance(obj_ctx, info.bucket.tenant, info.bucket.name);
-  auto rv = info.objv_tracker.read_version;
+  rgw_bucket bucket = info.bucket;
+  bucket.bucket_id.clear();
 
-  int r = instance.get_op()
-    .set_mtime(pmtime)
-    .set_attrs(pattrs)
-    .set_pinfo(&info)
-    .set_refresh_version(rv)
-    .exec();
-  if (r < 0) {
-    return r;
-  }
-
-  info = instance.get_bucket_info();
+  auto rv = info.objv_tracker.read_version;
 
-  return 0;
-}
-
-int RGWRados::put_bucket_entrypoint_info(const string& tenant_name, const string& bucket_name, RGWBucketEntryPoint& entry_point,
-                                         bool exclusive, RGWObjVersionTracker& objv_tracker, real_time mtime,
-                                         map<string, bufferlist> *pattrs)
-{
-  bufferlist epbl;
-  encode(entry_point, epbl);
-  string bucket_entry;
-  rgw_make_bucket_entry_name(tenant_name, bucket_name, bucket_entry);
-#warning FIXME
-#if 0
-  return rgw_bucket_store_info(this, bucket_entry, epbl, exclusive, pattrs, &objv_tracker, mtime);
-#endif
+  return ctl.bucket->read_bucket_info(bucket, &info,
+                                     RGWBucketCtl::BucketInstance::GetParams()
+                                     .set_mtime(pmtime)
+                                     .set_attrs(pattrs)
+                                     .set_refresh_version(rv));
 }
 
 int RGWRados::put_bucket_instance_info(RGWBucketInfo& info, bool exclusive,
                               real_time mtime, map<string, bufferlist> *pattrs)
 {
-  RGWSysObjectCtx obj_ctx = svc.sysobj->init_obj_ctx();
-  auto instance = svc.bucket->instance(obj_ctx, info.bucket.tenant, info.bucket.name);
-
-  return instance.set_op()
-    .set_exclusive(exclusive)
-    .set_mtime(mtime)
-    .set_attrs(pattrs)
-    .exec();
+  return ctl.bucket->store_bucket_instance_info(info.bucket, info,
+                                               RGWBucketCtl::BucketInstance::PutParams()
+                                               .set_exclusive(exclusive)
+                                               .set_mtime(mtime)
+                                               .set_attrs(pattrs));
 }
 
 int RGWRados::put_linked_bucket_info(RGWBucketInfo& info, bool exclusive, real_time mtime, obj_version *pep_objv,
@@ -7499,7 +7400,10 @@ int RGWRados::put_linked_bucket_info(RGWBucketInfo& info, bool exclusive, real_t
       *pep_objv = ot.write_version;
     }
   }
-  ret = put_bucket_entrypoint_info(info.bucket.tenant, info.bucket.name, entry_point, exclusive, ot, mtime, NULL); 
+  ret = ctl.bucket->store_bucket_entrypoint_info(info.bucket, entry_point, RGWBucketCtl::Bucket::PutParams()
+                                                                         .set_exclusive(exclusive)
+                                                                         .set_objv_tracker(&ot)
+                                                                         .set_mtime(mtime));
   if (ret < 0)
     return ret;
 
@@ -7560,7 +7464,7 @@ int RGWRados::append_async(rgw_raw_obj& obj, size_t size, bufferlist& bl)
   librados::Rados *rad = get_rados_handle();
   librados::AioCompletion *completion = rad->aio_create_completion(NULL, NULL, NULL);
 
-  r = ref.ioctx.aio_append(ref.obj.oid, completion, bl, size);
+  r = ref.pool.ioctx().aio_append(ref.obj.oid, completion, bl, size);
   completion->release();
   return r;
 }
@@ -7775,18 +7679,22 @@ int RGWRados::bi_get(const RGWBucketInfo& bucket_info, const rgw_obj& obj,
   }
 
   cls_rgw_obj_key key(obj.key.get_index_key_name(), obj.key.instance);
+
+  auto& ref = bs.bucket_obj.get_ref();
   
-  return cls_rgw_bi_get(bs.index_ctx, bs.bucket_obj, index_type, key, entry);
+  return cls_rgw_bi_get(ref.pool.ioctx(), ref.obj.oid, index_type, key, entry);
 }
 
 void RGWRados::bi_put(ObjectWriteOperation& op, BucketShard& bs, rgw_cls_bi_entry& entry)
 {
-  cls_rgw_bi_put(op, bs.bucket_obj, entry);
+  auto& ref = bs.bucket_obj.get_ref();
+  cls_rgw_bi_put(op, ref.obj.oid, entry);
 }
 
 int RGWRados::bi_put(BucketShard& bs, rgw_cls_bi_entry& entry)
 {
-  int ret = cls_rgw_bi_put(bs.index_ctx, bs.bucket_obj, entry);
+  auto& ref = bs.bucket_obj.get_ref();
+  int ret = cls_rgw_bi_put(ref.pool.ioctx(), ref.obj.oid, entry);
   if (ret < 0)
     return ret;
 
@@ -7815,7 +7723,8 @@ int RGWRados::bi_list(rgw_bucket& bucket, const string& obj_name, const string&
     return ret;
   }
 
-  ret = cls_rgw_bi_list(bs.index_ctx, bs.bucket_obj, obj_name, marker, max, entries, is_truncated);
+  auto& ref = bs.bucket_obj.get_ref();
+  ret = cls_rgw_bi_list(ref.pool.ioctx(), ref.obj.oid, obj_name, marker, max, entries, is_truncated);
   if (ret == -ENOENT) {
     *is_truncated = false;
   }
@@ -7827,7 +7736,8 @@ int RGWRados::bi_list(rgw_bucket& bucket, const string& obj_name, const string&
 
 int RGWRados::bi_list(BucketShard& bs, const string& filter_obj, const string& marker, uint32_t max, list<rgw_cls_bi_entry> *entries, bool *is_truncated)
 {
-  int ret = cls_rgw_bi_list(bs.index_ctx, bs.bucket_obj, filter_obj, marker, max, entries, is_truncated);
+  auto& ref = bs.bucket_obj.get_ref();
+  int ret = cls_rgw_bi_list(ref.pool.ioctx(), ref.obj.oid, filter_obj, marker, max, entries, is_truncated);
   if (ret < 0)
     return ret;
 
@@ -7836,7 +7746,8 @@ int RGWRados::bi_list(BucketShard& bs, const string& filter_obj, const string& m
 
 int RGWRados::bi_remove(BucketShard& bs)
 {
-  int ret = bs.index_ctx.remove(bs.bucket_obj);
+  auto& ref = bs.bucket_obj.get_ref();
+  int ret = ref.pool.ioctx().remove(ref.obj.oid);
   if (ret == -ENOENT) {
     ret = 0;
   }
@@ -7920,7 +7831,7 @@ int RGWRados::cls_obj_prepare_op(BucketShard& bs, RGWModifyOp op, string& tag,
   cls_rgw_obj_key key(obj.key.get_index_key_name(), obj.key.instance);
   cls_rgw_guard_bucket_resharding(o, -ERR_BUSY_RESHARDING);
   cls_rgw_bucket_prepare_op(o, op, tag, key, obj.key.get_loc(), svc.zone->get_zone().log_data, bilog_flags, zones_trace);
-  return rgw_rados_operate(bs.index_ctx, bs.bucket_obj, &o, y);
+  return bs.bucket_obj.operate(&o, y);
 }
 
 int RGWRados::cls_obj_complete_op(BucketShard& bs, const rgw_obj& obj, RGWModifyOp op, string& tag,
@@ -7950,7 +7861,7 @@ int RGWRados::cls_obj_complete_op(BucketShard& bs, const rgw_obj& obj, RGWModify
   index_completion_manager->create_completion(obj, op, tag, ver, key, dir_meta, remove_objs,
                                               svc.zone->get_zone().log_data, bilog_flags, &zones_trace, &arg);
   librados::AioCompletion *completion = arg->rados_completion;
-  int ret = bs.index_ctx.aio_operate(bs.bucket_obj, arg->rados_completion, &o);
+  int ret = bs.bucket_obj.aio_operate(arg->rados_completion, &o);
   completion->release(); /* can't reference arg here, as it might have already been released */
   return ret;
 }
@@ -7991,13 +7902,13 @@ int RGWRados::cls_obj_complete_cancel(BucketShard& bs, string& tag, rgw_obj& obj
 
 int RGWRados::cls_obj_set_bucket_tag_timeout(RGWBucketInfo& bucket_info, uint64_t timeout)
 {
-  librados::IoCtx index_ctx;
+  RGWSI_RADOS::Pool index_pool;
   map<int, string> bucket_objs;
-  int r = open_bucket_index(bucket_info, index_ctx, bucket_objs);
+  int r = svc.bi_rados->open_bucket_index(bucket_info, std::nullopt, &index_pool, &bucket_objs, nullptr);
   if (r < 0)
     return r;
 
-  return CLSRGWIssueSetTagTimeout(index_ctx, bucket_objs, cct->_conf->rgw_bucket_index_max_aio, timeout)();
+  return CLSRGWIssueSetTagTimeout(index_pool.ioctx(), bucket_objs, cct->_conf->rgw_bucket_index_max_aio, timeout)();
 }
 
 
@@ -8017,18 +7928,20 @@ int RGWRados::cls_bucket_list_ordered(RGWBucketInfo& bucket_info,
     " start " << start.name << "[" << start.instance << "] num_entries " <<
     num_entries << dendl;
 
-  librados::IoCtx index_ctx;
+  RGWSI_RADOS::Pool index_pool;
   // key   - oid (for different shards if there is any)
   // value - list result for the corresponding oid (shard), it is filled by
   //         the AIO callback
   map<int, string> oids;
   map<int, struct rgw_cls_list_ret> list_results;
-  int r = open_bucket_index(bucket_info, index_ctx, oids, shard_id);
+  int r = svc.bi_rados->open_bucket_index(bucket_info, shard_id, &index_pool, &oids, nullptr);
   if (r < 0)
     return r;
 
+  auto& ioctx = index_pool.ioctx();
+
   cls_rgw_obj_key start_key(start.name, start.instance);
-  r = CLSRGWIssueBucketList(index_ctx, start_key, prefix, num_entries,
+  r = CLSRGWIssueBucketList(ioctx, start_key, prefix, num_entries,
                            list_versions, oids, list_results,
                            cct->_conf->rgw_bucket_index_max_aio)();
   if (r < 0)
@@ -8077,7 +7990,7 @@ int RGWRados::cls_bucket_list_ordered(RGWBucketInfo& bucket_info,
       /* there are uncommitted ops. We need to check the current state,
        * and if the tags are old we need to do cleanup as well. */
       librados::IoCtx sub_ctx;
-      sub_ctx.dup(index_ctx);
+      sub_ctx.dup(ioctx);
       r = check_disk_state(sub_ctx, bucket_info, dirent, dirent,
                           updates[vnames[pos]], y);
       if (r < 0 && r != -ENOENT) {
@@ -8107,7 +8020,7 @@ int RGWRados::cls_bucket_list_ordered(RGWBucketInfo& bucket_info,
       cls_rgw_suggest_changes(o, miter->second);
       // we don't care if we lose suggested updates, send them off blindly
       AioCompletion *c = librados::Rados::aio_create_completion(NULL, NULL, NULL);
-      index_ctx.aio_operate(miter->first, c, &o);
+      ioctx.aio_operate(miter->first, c, &o);
       c->release();
     }
   }
@@ -8144,12 +8057,15 @@ int RGWRados::cls_bucket_list_unordered(RGWBucketInfo& bucket_info,
   static MultipartMetaFilter multipart_meta_filter;
 
   *is_truncated = false;
-  librados::IoCtx index_ctx;
+  RGWSI_RADOS::Pool index_pool;
 
   map<int, string> oids;
-  int r = open_bucket_index(bucket_info, index_ctx, oids, shard_id);
+  int r = svc.bi_rados->open_bucket_index(bucket_info, shard_id, &index_pool, &oids, nullptr);
   if (r < 0)
     return r;
+
+  auto& ioctx = index_pool.ioctx();
+
   const uint32_t num_shards = oids.size();
 
   rgw_obj_index_key marker = start;
@@ -8188,7 +8104,7 @@ int RGWRados::cls_bucket_list_unordered(RGWBucketInfo& bucket_info,
     } else {
       // so now we have the key used to compute the bucket index shard
       // and can extract the specific shard from it
-      current_shard = rgw_bucket_shard_index(obj_key.name, num_shards);
+      current_shard = svc.bi_rados->bucket_shard_index(obj_key.name, num_shards);
     }
   }
 
@@ -8204,7 +8120,7 @@ int RGWRados::cls_bucket_list_unordered(RGWBucketInfo& bucket_info,
     librados::ObjectReadOperation op;
     cls_rgw_bucket_list_op(op, marker, prefix, num_entries,
                            list_versions, &result);
-    r = index_ctx.operate(oid, &op, nullptr);
+    r = ioctx.operate(oid, &op, nullptr);
     if (r < 0)
       return r;
 
@@ -8219,9 +8135,8 @@ int RGWRados::cls_bucket_list_unordered(RGWBucketInfo& bucket_info,
        /* there are uncommitted ops. We need to check the current state,
         * and if the tags are old we need to do cleanup as well. */
        librados::IoCtx sub_ctx;
-       sub_ctx.dup(index_ctx);
-       r = check_disk_state(sub_ctx, bucket_info, dirent, dirent, updates[oid]
-            , null_yield);
+       sub_ctx.dup(ioctx);
+       r = check_disk_state(sub_ctx, bucket_info, dirent, dirent, updates[oid], y);
        if (r < 0 && r != -ENOENT) {
          return r;
        }
@@ -8264,7 +8179,7 @@ check_updates:
       cls_rgw_suggest_changes(o, miter->second);
       // we don't care if we lose suggested updates, send them off blindly
       AioCompletion *c = librados::Rados::aio_create_completion(NULL, NULL, NULL);
-      index_ctx.aio_operate(miter->first, c, &o);
+      ioctx.aio_operate(miter->first, c, &o);
       c->release();
     }
   }
@@ -8291,7 +8206,7 @@ int RGWRados::cls_obj_usage_log_add(const string& oid,
   ObjectWriteOperation op;
   cls_rgw_usage_log_add(op, info);
 
-  r = ref.ioctx.operate(ref.obj.oid, &op);
+  r = ref.pool.ioctx().operate(ref.obj.oid, &op);
   return r;
 }
 
@@ -8310,7 +8225,7 @@ int RGWRados::cls_obj_usage_log_read(const string& oid, const string& user, cons
 
   *is_truncated = false;
 
-  r = cls_rgw_usage_log_read(ref.ioctx, ref.obj.oid, user, bucket, start_epoch, end_epoch,
+  r = cls_rgw_usage_log_read(ref.pool.ioctx(), ref.obj.oid, user, bucket, start_epoch, end_epoch,
                             max_entries, read_iter, usage, is_truncated);
 
   return r;
@@ -8327,7 +8242,7 @@ int RGWRados::cls_obj_usage_log_trim(const string& oid, const string& user, cons
     return r;
   }
 
-  r = cls_rgw_usage_log_trim(ref.ioctx, ref.obj.oid, user, bucket, start_epoch, end_epoch);
+  r = cls_rgw_usage_log_trim(ref.pool.ioctx(), ref.obj.oid, user, bucket, start_epoch, end_epoch);
   return r;
 }
 
@@ -8342,19 +8257,19 @@ int RGWRados::cls_obj_usage_log_clear(string& oid)
   }
   librados::ObjectWriteOperation op;
   cls_rgw_usage_log_clear(op);
-  r = ref.ioctx.operate(ref.obj.oid, &op);
+  r = ref.pool.ioctx().operate(ref.obj.oid, &op);
   return r;
 }
 
 
 int RGWRados::remove_objs_from_index(RGWBucketInfo& bucket_info, list<rgw_obj_index_key>& oid_list)
 {
-  librados::IoCtx index_ctx;
+  RGWSI_RADOS::Pool index_pool;
   string dir_oid;
 
   uint8_t suggest_flag = (svc.zone->get_zone().log_data ? CEPH_RGW_DIR_SUGGEST_LOG_OP : 0);
 
-  int r = open_bucket_index(bucket_info, index_ctx, dir_oid);
+  int r = svc.bi_rados->open_bucket_index(bucket_info, &index_pool, &dir_oid);
   if (r < 0)
     return r;
 
@@ -8371,7 +8286,7 @@ int RGWRados::remove_objs_from_index(RGWBucketInfo& bucket_info, list<rgw_obj_in
 
   bufferlist out;
 
-  r = index_ctx.exec(dir_oid, RGW_CLASS, RGW_DIR_SUGGEST_CHANGES, updates, out);
+  r = index_pool.ioctx().exec(dir_oid, RGW_CLASS, RGW_DIR_SUGGEST_CHANGES, updates, out);
 
   return r;
 }
@@ -8489,17 +8404,17 @@ int RGWRados::check_disk_state(librados::IoCtx io_ctx,
 
 int RGWRados::cls_bucket_head(const RGWBucketInfo& bucket_info, int shard_id, vector<rgw_bucket_dir_header>& headers, map<int, string> *bucket_instance_ids)
 {
-  librados::IoCtx index_ctx;
+  RGWSI_RADOS::Pool index_pool;
   map<int, string> oids;
   map<int, struct rgw_cls_list_ret> list_results;
-  int r = open_bucket_index(bucket_info, index_ctx, oids, list_results, shard_id, bucket_instance_ids);
+  int r = svc.bi_rados->open_bucket_index(bucket_info, shard_id, &index_pool, &oids, bucket_instance_ids);
   if (r < 0) {
     ldout(cct, 20) << "cls_bucket_head: open_bucket_index() returned "
                    << r << dendl;
     return r;
   }
 
-  r = CLSRGWIssueGetDirHeader(index_ctx, oids, list_results, cct->_conf->rgw_bucket_index_max_aio)();
+  r = CLSRGWIssueGetDirHeader(index_pool.ioctx(), oids, list_results, cct->_conf->rgw_bucket_index_max_aio)();
   if (r < 0) {
     ldout(cct, 20) << "cls_bucket_head: CLSRGWIssueGetDirHeader() returned "
                    << r << dendl;
@@ -8515,15 +8430,15 @@ int RGWRados::cls_bucket_head(const RGWBucketInfo& bucket_info, int shard_id, ve
 
 int RGWRados::cls_bucket_head_async(const RGWBucketInfo& bucket_info, int shard_id, RGWGetDirHeader_CB *ctx, int *num_aio)
 {
-  librados::IoCtx index_ctx;
+  RGWSI_RADOS::Pool index_pool;
   map<int, string> bucket_objs;
-  int r = open_bucket_index(bucket_info, index_ctx, bucket_objs, shard_id);
+  int r = svc.bi_rados->open_bucket_index(bucket_info, shard_id, &index_pool, &bucket_objs, nullptr);
   if (r < 0)
     return r;
 
   map<int, string>::iterator iter = bucket_objs.begin();
   for (; iter != bucket_objs.end(); ++iter) {
-    r = cls_rgw_get_dir_header_async(index_ctx, iter->second, static_cast<RGWGetDirHeader_CB*>(ctx->get()));
+    r = cls_rgw_get_dir_header_async(index_pool.ioctx(), iter->second, static_cast<RGWGetDirHeader_CB*>(ctx->get()));
     if (r < 0) {
       ctx->put();
       break;
@@ -8534,48 +8449,6 @@ int RGWRados::cls_bucket_head_async(const RGWBucketInfo& bucket_info, int shard_
   return r;
 }
 
-int RGWRados::cls_user_get_header(const string& user_id, cls_user_header *header)
-{
-  string buckets_obj_id;
-  rgw_get_buckets_obj(user_id, buckets_obj_id);
-  rgw_raw_obj obj(svc.zone->get_zone_params().user_uid_pool, buckets_obj_id);
-
-  rgw_rados_ref ref;
-  int r = get_raw_obj_ref(obj, &ref);
-  if (r < 0) {
-    return r;
-  }
-
-  librados::ObjectReadOperation op;
-  int rc;
-  ::cls_user_get_header(op, header, &rc);
-  bufferlist ibl;
-  r = ref.ioctx.operate(ref.obj.oid, &op, &ibl);
-  if (r < 0)
-    return r;
-  if (rc < 0)
-    return rc;
-
-  return 0;
-}
-
-int RGWRados::cls_user_reset_stats(const string& user_id)
-{
-  string buckets_obj_id;
-  rgw_get_buckets_obj(user_id, buckets_obj_id);
-  rgw_raw_obj obj(svc.zone->get_zone_params().user_uid_pool, buckets_obj_id);
-
-  rgw_rados_ref ref;
-  int r = get_raw_obj_ref(obj, &ref);
-  if (r < 0) {
-    return r;
-  }
-
-  librados::ObjectWriteOperation op;
-  ::cls_user_reset_stats(op);
-  return ref.ioctx.operate(ref.obj.oid, &op);
-}
-
 int RGWRados::cls_user_get_header_async(const string& user_id, RGWGetUserHeader_CB *ctx)
 {
   string buckets_obj_id;
@@ -8588,32 +8461,7 @@ int RGWRados::cls_user_get_header_async(const string& user_id, RGWGetUserHeader_
     return r;
   }
 
-  r = ::cls_user_get_header_async(ref.ioctx, ref.obj.oid, ctx);
-  if (r < 0)
-    return r;
-
-  return 0;
-}
-
-int RGWRados::complete_sync_user_stats(const rgw_user& user_id)
-{
-  string buckets_obj_id;
-  rgw_get_buckets_obj(user_id, buckets_obj_id);
-  rgw_raw_obj obj(svc.zone->get_zone_params().user_uid_pool, buckets_obj_id);
-  return cls_user_complete_stats_sync(obj);
-}
-
-int RGWRados::cls_user_complete_stats_sync(rgw_raw_obj& obj)
-{
-  rgw_rados_ref ref;
-  int r = get_raw_obj_ref(obj, &ref);
-  if (r < 0) {
-    return r;
-  }
-
-  librados::ObjectWriteOperation op;
-  ::cls_user_complete_stats_sync(op);
-  r = ref.ioctx.operate(ref.obj.oid, &op);
+  r = ::cls_user_get_header_async(ref.pool.ioctx(), ref.obj.oid, ctx);
   if (r < 0)
     return r;
 
@@ -8695,7 +8543,7 @@ int RGWRados::get_target_shard_id(const RGWBucketInfo& bucket_info, const string
           *shard_id = -1;
         }
       } else {
-        uint32_t sid = rgw_bucket_shard_index(obj_key, bucket_info.num_shards);
+        uint32_t sid = svc.bi_rados->bucket_shard_index(obj_key, bucket_info.num_shards);
         if (shard_id) {
           *shard_id = (int)sid;
         }
@@ -8787,7 +8635,7 @@ int RGWRados::delete_raw_obj_aio(const rgw_raw_obj& obj, list<librados::AioCompl
   cls_rgw_remove_obj(op, prefixes);
 
   AioCompletion *c = librados::Rados::aio_create_completion(NULL, NULL, NULL);
-  ret = ref.ioctx.aio_operate(ref.obj.oid, c, &op);
+  ret = ref.pool.ioctx().aio_operate(ref.obj.oid, c, &op);
   if (ret < 0) {
     lderr(cct) << "ERROR: AioOperate failed with ret=" << ret << dendl;
     c->release();
@@ -8827,7 +8675,7 @@ int RGWRados::delete_obj_aio(const rgw_obj& obj,
   cls_rgw_remove_obj(op, prefixes);
 
   AioCompletion *c = librados::Rados::aio_create_completion(NULL, NULL, NULL);
-  ret = ref.ioctx.aio_operate(ref.obj.oid, c, &op);
+  ret = ref.pool.ioctx().aio_operate(ref.obj.oid, c, &op);
   if (ret < 0) {
     lderr(cct) << "ERROR: AioOperate failed with ret=" << ret << dendl;
     c->release();
index 558736af0ee8135f0d64ff62d92cc8560e713d25..261b559b145e5c17cc42dd971a1a5de8711e7edf 100644 (file)
@@ -650,8 +650,7 @@ public:
     RGWRados *store;
     rgw_bucket bucket;
     int shard_id;
-    librados::IoCtx index_ctx;
-    string bucket_obj;
+    RGWSI_RADOS::Obj bucket_obj;
 
     explicit BucketShard(RGWRados *_store) : store(_store), shard_id(-1) {}
     int init(const rgw_bucket& _bucket, const rgw_obj& obj, RGWBucketInfo* out);
@@ -1306,19 +1305,9 @@ public:
   int get_bucket_stats(RGWBucketInfo& bucket_info, int shard_id, string *bucket_ver, string *master_ver,
       map<RGWObjCategory, RGWStorageStats>& stats, string *max_marker, bool* syncstopped = NULL);
   int get_bucket_stats_async(RGWBucketInfo& bucket_info, int shard_id, RGWGetBucketStats_CB *cb);
-  int get_user_stats(const rgw_user& user, RGWStorageStats& stats);
   int get_user_stats_async(const rgw_user& user, RGWGetUserStats_CB *cb);
-  void get_bucket_instance_obj(const rgw_bucket& bucket, rgw_raw_obj& obj);
-  void get_bucket_meta_oid(const rgw_bucket& bucket, string& oid);
 
-  int put_bucket_entrypoint_info(const string& tenant_name, const string& bucket_name, RGWBucketEntryPoint& entry_point,
-                                 bool exclusive, RGWObjVersionTracker& objv_tracker, ceph::real_time mtime,
-                                 map<string, bufferlist> *pattrs);
   int put_bucket_instance_info(RGWBucketInfo& info, bool exclusive, ceph::real_time mtime, map<string, bufferlist> *pattrs);
-  int get_bucket_entrypoint_info(RGWSysObjectCtx& obj_ctx, const string& tenant_name, const string& bucket_name,
-                                 RGWBucketEntryPoint& entry_point, RGWObjVersionTracker *objv_tracker,
-                                 ceph::real_time *pmtime, map<string, bufferlist> *pattrs, rgw_cache_entry_info *cache_info = NULL,
-                                boost::optional<obj_version> refresh_version = boost::none);
   int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const string& meta_key, RGWBucketInfo& info, ceph::real_time *pmtime, map<string, bufferlist> *pattrs, optional_yield y);
   int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const rgw_bucket& bucket, RGWBucketInfo& info, ceph::real_time *pmtime, map<string, bufferlist> *pattrs, optional_yield y);
 
@@ -1421,11 +1410,7 @@ public:
   int fix_head_obj_locator(const RGWBucketInfo& bucket_info, bool copy_obj, bool remove_bad, rgw_obj_key& key);
   int fix_tail_obj_locator(const RGWBucketInfo& bucket_info, rgw_obj_key& key, bool fix, bool *need_fix, optional_yield y);
 
-  int cls_user_get_header(const string& user_id, cls_user_header *header);
-  int cls_user_reset_stats(const string& user_id);
   int cls_user_get_header_async(const string& user_id, RGWGetUserHeader_CB *ctx);
-  int cls_user_complete_stats_sync(rgw_raw_obj& obj);
-  int complete_sync_user_stats(const rgw_user& user_id);
 
   int check_quota(const rgw_user& bucket_owner, rgw_bucket& bucket,
                   RGWQuotaInfo& user_quota, RGWQuotaInfo& bucket_quota, uint64_t obj_size, bool check_size_only = false);
index 54914deca7c68d0b0311d2ef4d7752938fab476c..8c9ab5b821456d003c5068101af2fb0687c4643c 100644 (file)
@@ -1838,7 +1838,7 @@ int RGWHandler_REST::init_permissions(RGWOp* op)
     if (! s->user->user_id.empty() && s->auth.identity->get_identity_type() != TYPE_ROLE) {
       try {
         map<string, bufferlist> uattrs;
-        if (auto ret = rgw_get_user_attrs_by_uid(store->ctl.user, s->user->user_id, uattrs); ! ret) {
+        if (auto ret = store->ctl.user->get_attrs_by_uid(s->user->user_id, &uattrs); ! ret) {
           if (s->iam_user_policies.empty()) {
             s->iam_user_policies = get_iam_user_policy_from_attr(s->cct, store, uattrs, s->user->user_id.tenant);
           } else {
index 764166978367c44d3dfb7cf64efbb05a550de1af..74cde06d90e81a242d93b1b10bffded9d8b196b1 100644 (file)
@@ -24,6 +24,7 @@
 #include "rgw_data_sync.h"
 #include "rgw_common.h"
 #include "rgw_zone.h"
+#include "rgw_mdlog.h"
 
 #include "services/svc_zone.h"
 
@@ -100,7 +101,7 @@ void RGWOp_MDLog_List::execute() {
     }
   }
 
-  RGWMetadataLog meta_log{s->cct, store, period};
+  RGWMetadataLog meta_log{s->cct, store->svc.zone, store->svc.cls, period};
 
   meta_log.init_list_entries(shard_id, ut_st, ut_et, marker, &handle);
 
@@ -126,7 +127,7 @@ void RGWOp_MDLog_List::send_response() {
     for (list<cls_log_entry>::iterator iter = entries.begin();
         iter != entries.end(); ++iter) {
       cls_log_entry& entry = *iter;
-      store->meta_mgr->dump_log_entry(entry, s->formatter);
+      store->ctl.meta.mgr->dump_log_entry(entry, s->formatter);
       flusher.flush();
     }
     s->formatter->close_section();
@@ -137,7 +138,7 @@ void RGWOp_MDLog_List::send_response() {
 
 void RGWOp_MDLog_Info::execute() {
   num_objects = s->cct->_conf->rgw_md_log_max_shards;
-  period = store->meta_mgr->read_oldest_log_period();
+  period = store->ctl.meta.mgr->read_oldest_log_period();
   http_ret = period.get_error();
 }
 
@@ -178,7 +179,7 @@ void RGWOp_MDLog_ShardInfo::execute() {
       return;
     }
   }
-  RGWMetadataLog meta_log{s->cct, store, period};
+  RGWMetadataLog meta_log{s->cct, store->svc.zone, store->svc.ctl, period};
 
   http_ret = meta_log.get_info(shard_id, &info);
 }
@@ -237,7 +238,7 @@ void RGWOp_MDLog_Delete::execute() {
       return;
     }
   }
-  RGWMetadataLog meta_log{s->cct, store, period};
+  RGWMetadataLog meta_log{s->cct, store->svc.zone, store->svc.ctl, period};
 
   http_ret = meta_log.trim(shard_id, ut_st, ut_et, start_marker, end_marker);
 }
@@ -277,7 +278,7 @@ void RGWOp_MDLog_Lock::execute() {
     return;
   }
 
-  RGWMetadataLog meta_log{s->cct, store, period};
+  RGWMetadataLog meta_log{s->cct, store->svc.zone, store->svc.ctl, period};
   unsigned dur;
   dur = (unsigned)strict_strtol(duration_str.c_str(), 10, &err);
   if (!err.empty() || dur <= 0) {
@@ -324,7 +325,7 @@ void RGWOp_MDLog_Unlock::execute() {
     return;
   }
 
-  RGWMetadataLog meta_log{s->cct, store, period};
+  RGWMetadataLog meta_log{s->cct, store->svc.zone, store->svc.ctl, period};
   http_ret = meta_log.unlock(shard_id, zone_id, locker_id);
 }
 
@@ -416,9 +417,9 @@ void RGWOp_BILog_List::execute() {
   send_response();
   do {
     list<rgw_bi_log_entry> entries;
-    int ret = store->list_bi_log_entries(bucket_info, shard_id,
-                                          marker, max_entries - count, 
-                                          entries, &truncated);
+    int ret = store->svc.bilog->log_list(bucket_info, shard_id,
+                                         marker, max_entries - count, 
+                                         entries, &truncated);
     if (ret < 0) {
       ldpp_dout(s, 5) << "ERROR: list_bi_log_entries()" << dendl;
       return;
@@ -557,7 +558,7 @@ void RGWOp_BILog_Delete::execute() {
       return;
     }
   }
-  http_ret = store->trim_bi_log_entries(bucket_info, shard_id, start_marker, end_marker);
+  http_ret = store->svc.bilog->log_trim(bucket_info, shard_id, start_marker, end_marker);
   if (http_ret < 0) {
     ldpp_dout(s, 5) << "ERROR: trim_bi_log_entries() " << dendl;
   }
index d5fbf814529a0dee38ee694037b6e43e6009750b..cd82f2e675e9c51c24759ded8fcac58f67981eff 100644 (file)
@@ -17,6 +17,7 @@
 #define RGW_REST_LOG_H
 
 #include "rgw_metadata.h"
+#include "rgw_mdlog.h"
 
 class RGWOp_BILog_List : public RGWRESTOp {
   bool sent_header;
index 18e37676c4384f5c7f259ed1858d1b81780fa354..c1135128c82d29118ecf2498396e9cb2b82ed6e5 100644 (file)
@@ -8,6 +8,7 @@
 #include "rgw_zone.h"
 
 #include "services/svc_zone.h"
+#include "services/svc_mdlog.h"
 
 #include "include/ceph_assert.h"
 
@@ -169,6 +170,8 @@ void RGWOp_Period_Post::execute()
     return;
   }
 
+  auto period_history = store->svc.mdlog->get_period_history();
+
   // decide whether we can set_current_period() or set_latest_epoch()
   if (period.get_id() != current_period.get_id()) {
     auto current_epoch = current_period.get_realm_epoch();
@@ -189,7 +192,7 @@ void RGWOp_Period_Post::execute()
       return;
     }
     // attach a copy of the period into the period history
-    auto cursor = store->period_history->attach(RGWPeriod{period});
+    auto cursor = period_history->attach(RGWPeriod{period});
     if (!cursor) {
       // we're missing some history between the new period and current_period
       http_ret = cursor.get_error();
@@ -230,7 +233,7 @@ void RGWOp_Period_Post::execute()
       << ", updating period's latest epoch and notifying zone" << dendl;
   realm.notify_new_period(period);
   // update the period history
-  store->period_history->insert(RGWPeriod{period});
+  period_history->insert(RGWPeriod{period});
 }
 
 class RGWHandler_Period : public RGWHandler_Auth_S3 {
index 7dc772c3f670fa3a96d0d78032d444c15e5e972e..32522e7ab34c682b5eb54589826a99bab110883f 100644 (file)
@@ -25,7 +25,7 @@ int RGWRestRole::verify_permission()
   }
 
   string role_name = s->info.args.get("RoleName");
-  RGWRole role(s->cct, store, role_name, s->user->user_id.tenant);
+  RGWRole role(s->cct, store->pctl, role_name, s->user->user_id.tenant);
   if (op_ret = role.get(); op_ret < 0) {
     if (op_ret == -ENOENT) {
       op_ret = -ERR_NO_ROLE_FOUND;
@@ -129,7 +129,7 @@ void RGWCreateRole::execute()
   if (op_ret < 0) {
     return;
   }
-  RGWRole role(s->cct, store, role_name, role_path, trust_policy,
+  RGWRole role(s->cct, store->pctl, role_name, role_path, trust_policy,
                 s->user->user_id.tenant, max_session_duration);
   op_ret = role.create(true);
 
@@ -228,7 +228,7 @@ void RGWGetRole::execute()
   if (op_ret < 0) {
     return;
   }
-  RGWRole role(s->cct, store, role_name, s->user->user_id.tenant);
+  RGWRole role(s->cct, store->pctl, role_name, s->user->user_id.tenant);
   op_ret = role.get();
 
   if (op_ret == -ENOENT) {
index f5b2e4e7f2236a42752b10f14c1352f85586c32a..e3873d0882d89663f16159b76e0aa50cd5bc3df4 100644 (file)
@@ -545,7 +545,7 @@ static void dump_container_metadata(struct req_state *s,
 void RGWStatAccount_ObjStore_SWIFT::execute()
 {
   RGWStatAccount_ObjStore::execute();
-  op_ret = rgw_get_user_attrs_by_uid(store, s->user->user_id, attrs);
+  op_ret = store->ctl.user->get_attrs_by_uid(s->user->user_id, &attrs);
 }
 
 void RGWStatAccount_ObjStore_SWIFT::send_response()
index 7afd11775b78364760392d7a7b317ae811822d6e..0ece53de6caa9ca02a9682eb89990fc97b5d5869 100644 (file)
@@ -118,14 +118,14 @@ void RGWPutUserPolicy::execute()
 
   RGWUserInfo info;
   rgw_user user_id(user_name);
-  op_ret = rgw_get_user_info_by_uid(store, user_id, info);
+  op_ret = rgw_get_user_info_by_uid(store->ctl.user, user_id, info);
   if (op_ret < 0) {
     op_ret = -ERR_NO_SUCH_ENTITY;
     return;
   }
 
   map<string, bufferlist> uattrs;
-  op_ret = rgw_get_user_attrs_by_uid(store, user_id, uattrs);
+  op_ret = store->ctl.user->get_attrs_by_uid(user_id, &uattrs);
   if (op_ret == -ENOENT) {
     op_ret = -ERR_NO_SUCH_ENTITY;
     return;
@@ -144,7 +144,7 @@ void RGWPutUserPolicy::execute()
     uattrs[RGW_ATTR_USER_POLICY] = in_bl;
 
     RGWObjVersionTracker objv_tracker;
-    op_ret = rgw_store_user_info(store, info, &info, &objv_tracker, real_time(), false, &uattrs);
+    op_ret = rgw_store_user_info(store->ctl.user, info, &info, &objv_tracker, real_time(), false, &uattrs);
     if (op_ret < 0) {
       op_ret = -ERR_INTERNAL_ERROR;
     }
@@ -190,7 +190,7 @@ void RGWGetUserPolicy::execute()
 
   rgw_user user_id(user_name);
   map<string, bufferlist> uattrs;
-  op_ret = rgw_get_user_attrs_by_uid(store, user_id, uattrs);
+  op_ret = store->ctl.user->get_attrs_by_uid(user_id, &uattrs);
   if (op_ret == -ENOENT) {
     ldout(s->cct, 0) << "ERROR: attrs not found for user" << user_name << dendl;
     op_ret = -ERR_NO_SUCH_ENTITY;
@@ -254,7 +254,7 @@ void RGWListUserPolicies::execute()
 
   rgw_user user_id(user_name);
   map<string, bufferlist> uattrs;
-  op_ret = rgw_get_user_attrs_by_uid(store, user_id, uattrs);
+  op_ret = store->ctl.user->get_attrs_by_uid(user_id, &uattrs);
   if (op_ret == -ENOENT) {
     ldout(s->cct, 0) << "ERROR: attrs not found for user" << user_name << dendl;
     op_ret = -ERR_NO_SUCH_ENTITY;
@@ -316,14 +316,14 @@ void RGWDeleteUserPolicy::execute()
 
   RGWUserInfo info;
   rgw_user user_id(user_name);
-  op_ret = rgw_get_user_info_by_uid(store, user_id, info);
+  op_ret = store->ctl.user->get_info_by_uid(user_id, &info);
   if (op_ret < 0) {
     op_ret = -ERR_NO_SUCH_ENTITY;
     return;
   }
 
   map<string, bufferlist> uattrs;
-  op_ret = rgw_get_user_attrs_by_uid(store, user_id, uattrs);
+  op_ret = store->ctl.user->get_attrs_by_uid(user_id, &uattrs);
   if (op_ret == -ENOENT) {
     op_ret = -ERR_NO_SUCH_ENTITY;
     return;
@@ -341,7 +341,10 @@ void RGWDeleteUserPolicy::execute()
       uattrs[RGW_ATTR_USER_POLICY] = in_bl;
 
       RGWObjVersionTracker objv_tracker;
-      op_ret = rgw_store_user_info(store, info, &info, &objv_tracker, real_time(), false, &uattrs);
+      op_ret = store->ctl.user->store_info(info, RGWUserCtl::PutParams()
+                                                .set_old_info(&info),
+                                                .set_objv_tracker(&objv_tracker)
+                                                .set_attrs(&uattrs));
       if (op_ret < 0) {
         op_ret = -ERR_INTERNAL_ERROR;
       }
index 80daa04cbbcaf61c18773e0a9a78e4347e7bc558..3624eacb3b775189d99b838a42469cdef5414ba8 100644 (file)
@@ -251,7 +251,7 @@ std::tuple<int, RGWRole> STSService::getRoleInfo(const string& arn)
   if (auto r_arn = rgw::ARN::parse(arn); r_arn) {
     auto pos = r_arn->resource.find_last_of('/');
     string roleName = r_arn->resource.substr(pos + 1);
-    RGWRole role(cct, store, roleName, r_arn->account);
+    RGWRole role(cct, store->pctl, roleName, r_arn->account);
     if (int ret = role.get(); ret < 0) {
       if (ret == -ENOENT) {
         ret = -ERR_NO_ROLE_FOUND;
@@ -270,14 +270,14 @@ int STSService::storeARN(string& arn)
 {
   int ret = 0;
   RGWUserInfo info;
-  if (ret = rgw_get_user_info_by_uid(store, user_id, info); ret < 0) {
+  if (ret = rgw_get_user_info_by_uid(store->ctl.user, user_id, info); ret < 0) {
     return -ERR_NO_SUCH_ENTITY;
   }
 
   info.assumed_role_arn = arn;
 
   RGWObjVersionTracker objv_tracker;
-  if (ret = rgw_store_user_info(store, info, &info, &objv_tracker, real_time(),
+  if (ret = rgw_store_user_info(store->ctl.user, info, &info, &objv_tracker, real_time(),
           false); ret < 0) {
     return -ERR_INTERNAL_ERROR;
   }
index a42b872a07d6f9e23bb4978ba674bcca0914a773..db75fe887ba631f65bb2d0cd3521b31d96ae2f16 100644 (file)
@@ -175,7 +175,7 @@ int DataLogTrimPollCR::operate()
       // request a 'data_trim' lock that covers the entire wait interval to
       // prevent other gateways from attempting to trim for the duration
       set_status("acquiring trim lock");
-      yield call(new RGWSimpleRadosLockCR(store->get_async_rados(), store,
+      yield call(new RGWSimpleRadosLockCR(store->svc.rados->get_async_processor(), store,
                                           rgw_raw_obj(store->svc.zone->get_zone_params().log_pool, lock_oid),
                                           "data_trim", lock_cookie,
                                           interval.sec()));
index 737d79c64556a8981fc6cd326b8b1c82e71d8b78..5771b0770c97adde8939c33ef7b2b0cd7408e605 100644 (file)
@@ -91,7 +91,7 @@ int PurgePeriodLogsCR::operate()
       ldout(cct, 4) << "purging log shards for realm_epoch=" << cursor.get_epoch()
           << " period=" << cursor.get_period().get_id() << dendl;
       yield {
-        const auto mdlog = metadata->get_log(cursor.get_period().get_id());
+        const auto mdlog = svc.mdlog->get_log(cursor.get_period().get_id());
         const auto& pool = svc.zone->get_zone_params().log_pool;
         auto num_shards = cct->_conf->rgw_md_log_max_shards;
         call(new PurgeLogShardsCR(store, mdlog, pool, num_shards));
index 89d91baac1202bc023f4e29c562ca1559ce7845f..5f2754235303e8af4147bd8cca44fb623a97be4f 100644 (file)
@@ -100,7 +100,7 @@ int rgw_user_sync_all_stats(RGWRados *store, const rgw_user& user_id)
     }
   } while (is_truncated);
 
-  ret = store->complete_sync_user_stats(user_id);
+  ret = store->ctl.user->complete_flush_stats(user_id);
   if (ret < 0) {
     cerr << "ERROR: failed to complete syncing user stats: ret=" << ret << std::endl;
     return ret;
@@ -109,7 +109,7 @@ int rgw_user_sync_all_stats(RGWRados *store, const rgw_user& user_id)
   return 0;
 }
 
-int rgw_user_get_all_buckets_stats(RGWRados *store, const rgw_user& user_id, map<string, cls_user_bucket_entry>&buckets_usage_map)
+int rgw_user_get_all_buckets_stats(RGWRados *store, const rgw_user& user_id, map<string, cls_user_bucket_entry>& buckets_usage_map)
 {
   CephContext *cct = store->ctx();
   size_t max_entries = cct->_conf->rgw_list_buckets_max_chunk;
@@ -233,31 +233,6 @@ extern int rgw_get_user_info_by_access_key(RGWUserCtl *user_ctl,
                                                       .set_yield(null_yield));
 }
 
-int rgw_get_user_attrs_by_uid(RGWUserCtl *user_ctl,
-                              const rgw_user& user_id,
-                              map<string, bufferlist>& attrs,
-                              RGWObjVersionTracker *objv_tracker)
-{
-  RGWUserInfo user_info;
-
-  return user_ctl->get_info_by_uid(user_id, &user_info, RGWUserCtl::GetParams()
-                                            .set_objv_tracker(objv_tracker)
-                                            .set_attrs(&attrs)
-                                            .set_yield(null_yield));
-}
-
-/**
- * delete a user's presence from the RGW system.
- * First remove their bucket ACLs, then delete them
- * from the user and user email pools. This leaves the pools
- * themselves alone, as well as any ACLs embedded in object xattrs.
- */
-int rgw_delete_user(RGWUserCtl *user_ctl, RGWUserInfo& info, RGWObjVersionTracker& objv_tracker) {
-  return user_ctl->remove_info(info, RGWUserCtl::RemoveParams()
-                                     .set_objv_tracker(&objv_tracker)
-                                     .set_yield(null_yield));
-}
-
 static bool char_is_unreserved_url(char c)
 {
   if (isalnum(c))
@@ -1796,7 +1771,8 @@ int RGWUser::execute_remove(RGWUserAdminOpState& op_state, std::string *err_msg,
 
   } while (is_truncated);
 
-  ret = rgw_delete_user(user_ctl, user_info, op_state.objv);
+  ret = user_ctl->remove_info(user_info, RGWUserCtl::RemoveParams()
+                                         .set_objv_tracker(&op_state.objv));
   if (ret < 0) {
     set_err_msg(err_msg, "unable to remove user from RADOS");
     return ret;
@@ -2120,7 +2096,7 @@ int RGWUserAdminOp_User::info(RGWRados *store, RGWUserAdminOpState& op_state,
   RGWStorageStats stats;
   RGWStorageStats *arg_stats = NULL;
   if (op_state.fetch_stats) {
-    int ret = store->get_user_stats(info.user_id, stats);
+    int ret = store->ctl.user->get_stats(info.user_id, stats);
     if (ret < 0 && ret != -ENOENT) {
       return ret;
     }
@@ -2635,6 +2611,19 @@ int RGWUserCtl::get_info_by_access_key(const string& access_key,
   });
 }
 
+int RGWUserCtl::get_attrs_by_uid(const rgw_user& user_id,
+                                 map<string, bufferlist> *pattrs,
+                                 optional_yield y,
+                                 RGWObjVersionTracker *objv_tracker)
+{
+  RGWUserInfo user_info;
+
+  return get_info_by_uid(user_id, &user_info, RGWUserCtl::GetParams()
+                         .set_attrs(pattrs)
+                         .set_yield(y)
+                         .set_objv_tracker(objv_tracker));
+}
+
 int RGWUserCtl::store_info(const RGWUserInfo& info, ceph::optional_ref_default<PutParams> params)
 {
   string key = RGWSI_User::get_meta_key(info.user_id);
@@ -2720,6 +2709,27 @@ int RGWUserCtl::flush_bucket_stats(const rgw_user& user,
   });
 }
 
+int RGWUserCtl::complete_flush_stats(const rgw_user& user)
+{
+  return be_handler->call([&](RGWSI_MetaBackend_Handler::Op *op) {
+    return svc.user->complete_flush_stats(op->ctx(), user);
+  });
+}
+
+int RGWUserCtl::reset_stats(const rgw_user& user)
+{
+  return be_handler->call([&](RGWSI_MetaBackend_Handler::Op *op) {
+    return svc.user->reset_bucket_stats(op->ctx(), user);
+  });
+}
+
+int RGWUserCtl::read_stats(const rgw_user& user, RGWStorageStats *stats)
+{
+  return be_handler->call([&](RGWSI_MetaBackend_Handler::Op *op) {
+    return svc.user->reset_bucket_stats(op->ctx(), user, stats);
+  });
+}
+
 RGWMetadataHandler *RGWUserMetaHandlerAllocator::alloc(RGWSI_User *user_svc) {
   return new RGWUserMetadataHandler(user_svc);
 }
index a0e8bcf7711b04264f95fea81156255049433b8b..8bdae9020b7f16132f67bccf42e6b49d043f3ba9 100644 (file)
@@ -112,19 +112,6 @@ extern int rgw_get_user_info_by_access_key(RGWUserCtl *user_ctl,
                                            RGWUserInfo& info,
                                            RGWObjVersionTracker* objv_tracker = nullptr,
                                            real_time* pmtime = nullptr);
-/**
- * Get all the custom metadata stored for user specified in @user_id
- * and put it into @attrs.
- * Returns: 0 on success, -ERR# on failure.
- */
-extern int rgw_get_user_attrs_by_uid(RGWUserCtl *user_ctl,
-                                     const rgw_user& user_id,
-                                     map<string, bufferlist>& attrs,
-                                     RGWObjVersionTracker *objv_tracker = nullptr);
-/**
- * Given an RGWUserInfo, deletes the user and its bucket ACLs.
- */
-extern int rgw_delete_user(RGWUserCtl *user_ctl, RGWUserInfo& user, RGWObjVersionTracker& objv_tracker);
 
 extern void rgw_perm_to_str(uint32_t mask, char *buf, int len);
 extern uint32_t rgw_str_to_perm(const char *str);
@@ -923,6 +910,11 @@ public:
   int get_info_by_swift(const string& swift_name, RGWUserInfo *info, ceph::optional_ref_default<GetParams> params = std::nullopt);
   int get_info_by_access_key(const string& access_key, RGWUserInfo *info, ceph::optional_ref_default<GetParams> params = std::nullopt);
 
+  int get_attrs_by_uid(const rgw_user& user_id,
+                       map<string, bufferlist> *attrs,
+                       optional_yield y,
+                       RGWObjVersionTracker *objv_tracker = nullptr);
+
   int store_info(const RGWUserInfo& info, ceph::optional_ref_default<PutParams> params);
   int remove_info(const RGWUserInfo& info, ceph::optional_ref_default<RemoveParams> params);
 
@@ -942,6 +934,8 @@ public:
 
   int flush_bucket_stats(const rgw_user& user,
                          const RGWBucketEnt& ent);
+  int reset_stats(const rgw_user& user);
+  int read_stats(const rgw_user& user, RGWStorageStats *stats);
 };
 
 class RGWUserMetaHandlerAllocator {
index ac3b30d2b79c1f9b0c127cbf66c81e1638b99b20..bfe3631e73ee80b626a3dcc03552ceba4ac3d0d8 100644 (file)
@@ -1343,7 +1343,7 @@ void RGWPeriod::fork()
 static int read_sync_status(RGWRados *store, rgw_meta_sync_status *sync_status)
 {
   // initialize a sync status manager to read the status
-  RGWMetaSyncStatusManager mgr(store, store->get_async_rados());
+  RGWMetaSyncStatusManager mgr(store, store->svc.rados->get_async_processor());
   int r = mgr.init();
   if (r < 0) {
     return r;
index c280c846b8ff1ade9d5fc2ae12554dbbad05d321..ec51d8a75a6905e7d5ffafb99268744147eec16d 100644 (file)
@@ -224,31 +224,37 @@ int RGWSI_BucketIndex_RADOS::get_bucket_index_object(const string& bucket_oid_ba
 
 int RGWSI_BucketIndex_RADOS::open_bucket_index_shard(const RGWBucketInfo& bucket_info,
                                                      const string& obj_key,
-                                                     RGWSI_RADOS::Pool *index_pool,
-                                                     string *bucket_obj,
+                                                     RGWSI_RADOS::Obj *bucket_obj,
                                                      int *shard_id)
 {
   string bucket_oid_base;
-  int ret = open_bucket_index_base(bucket_info, index_pool, &bucket_oid_base);
+
+  RGWSI_RADOS::Pool pool;
+
+  int ret = open_bucket_index_base(bucket_info, &pool, &bucket_oid_base);
   if (ret < 0) {
     ldout(cct, 20) << __func__ << ": open_bucket_index_pool() returned "
                    << r << dendl;
     return ret;
   }
 
+  string oid;
+
   ret = get_bucket_index_object(bucket_oid_base, obj_key, bucket_info.num_shards,
-        (RGWBucketInfo::BIShardsHashType)bucket_info.bucket_index_shard_hash_type, bucket_obj, shard_id);
+        (RGWBucketInfo::BIShardsHashType)bucket_info.bucket_index_shard_hash_type, &oid, shard_id);
   if (ret < 0) {
     ldout(cct, 10) << "get_bucket_index_object() returned ret=" << ret << dendl;
     return ret;
   }
+
+  *bucket_obj = svc.rados->obj(pool, oid);
+
   return 0;
 }
 
 int RGWSI_BucketIndex_RADOS::open_bucket_index_shard(const RGWBucketInfo& bucket_info,
                                                      int shard_id,
-                                                     RGWSI_RADOS::Pool *index_pool,
-                                                     string *bucket_obj)
+                                                     RGWSI_RADOS::Obj *bucket_obj)
 {
   string bucket_oid_base;
   int ret = open_bucket_index_base(bucket_info, index_pool, &bucket_oid_base);
@@ -258,8 +264,13 @@ int RGWSI_BucketIndex_RADOS::open_bucket_index_shard(const RGWBucketInfo& bucket
     return ret;
   }
 
+  string oid;
+
   get_bucket_index_object(bucket_oid_base, bucket_info.num_shards,
-                          shard_id, bucket_obj);
+                          shard_id, &oid);
+
+  *bucket_obj = svc.rados->obj(pool, oid);
+
   return 0;
 }
 
index 9e16437fac1dafa2d860d2844c15e4457b3d04e5..567f84f1c1b5cb1c982de43da72662f44cac3769 100644 (file)
@@ -45,14 +45,6 @@ class RGWSI_BucketIndex_RADOS : public RGWSI_BucketIndex
   int open_bucket_index_base(const RGWBucketInfo& bucket_info,
                              RGWSI_RADOS::Pool *index_pool,
                              string *bucket_oid_base);
-  int open_bucket_index(const RGWBucketInfo& bucket_info,
-                        RGWSI_RADOS::Pool *index_pool,
-                        string *bucket_oid);
-  int open_bucket_index(const RGWBucketInfo& bucket_info,
-                        std::optional<int> shard_id,
-                        RGWSI_RADOS::Pool *index_pool,
-                        map<int, string> *bucket_objs,
-                        map<int, string> *bucket_instance_ids);
 
   void get_bucket_index_object(const string& bucket_oid_base,
                                uint32_t num_shards,
@@ -62,16 +54,6 @@ class RGWSI_BucketIndex_RADOS : public RGWSI_BucketIndex
                               uint32_t num_shards, RGWBucketInfo::BIShardsHashType hash_type,
                               string *bucket_obj, int *shard_id);
 
-  int open_bucket_index_shard(const RGWBucketInfo& bucket_info,
-                              const string& obj_key,
-                              RGWSI_RADOS::Pool *index_pool,
-                              string *bucket_obj,
-                              int *shard_id);
-  int open_bucket_index_shard(const RGWBucketInfo& bucket_info,
-                              int shard_id,
-                              RGWSI_RADOS::Pool *index_pool,
-                              string *bucket_obj);
-
   int cls_bucket_head(const RGWBucketInfo& bucket_info,
                       int shard_id,
                       vector<rgw_bucket_dir_header> *headers,
@@ -109,6 +91,9 @@ public:
   int init_index(RGWBucketInfo& bucket_info);
   int clean_index(RGWBucketInfo& bucket_info);
 
+
+  /* RADOS specific */
+
   int read_stats(const RGWBucketInfo& bucket_info,
                  RGWBucketEnt *stats) override;
 
@@ -117,6 +102,25 @@ public:
 
   int handle_overwrite(const RGWBucketInfo& info,
                        const RGWBucketInfo& orig_info) override;
+
+  int open_bucket_index_shard(const RGWBucketInfo& bucket_info,
+                              const string& obj_key,
+                              RGWSI_RADOS::Obj *bucket_obj,
+                              int *shard_id);
+
+  int open_bucket_index_shard(const RGWBucketInfo& bucket_info,
+                              int shard_id,
+                              RGWSI_RADOS::Obj *bucket_obj);
+
+  int open_bucket_index(const RGWBucketInfo& bucket_info,
+                        RGWSI_RADOS::Pool *index_pool,
+                        string *bucket_oid);
+
+  int open_bucket_index(const RGWBucketInfo& bucket_info,
+                        std::optional<int> shard_id,
+                        RGWSI_RADOS::Pool *index_pool,
+                        map<int, string> *bucket_objs,
+                        map<int, string> *bucket_instance_ids);
 };
 
 
index 45cb1519d91faba7146f73c2d3b13c256dc059d0..4080a1b2ef4fb4963c60b115d8af3666d8e52917 100644 (file)
@@ -44,6 +44,11 @@ int RGWSI_MDLog::do_start()
   period_puller.reset(new RGWPeriodPuller(svc.zone, svc.sysobj));
   period_history.reset(new RGWPeriodHistory(cct, period_puller.get(),
                                             current_period.get_id()));
+
+  if (svc.zone->need_sync()) {
+    // initialize the log period history
+    svc.mdlog->init_oldest_log_period();
+  }
   return 0;
 }
 
index 123f9fa70dacfb0533df2b268228bce044d9310a..5bfbf8a82cb10a97b76a3072132d9c97e8bdffd5 100644 (file)
@@ -88,10 +88,10 @@ int RGWSI_RADOS::pool_iterate(librados::IoCtx& io_ctx,
   return objs.size();
 }
 
-RGWSI_RADOS::Obj::Obj(Pool& pool, const rgw_raw_obj& obj) : rados_svc(pool.rados_svc), rados_handle(pool.rados_handle)
+RGWSI_RADOS::Obj::Obj(Pool& pool, const string& oid) : rados_svc(pool.rados_svc), rados_handle(pool.rados_handle)
 {
   ref.pool = pool;
-  ref.obj = obj;
+  ref.obj = rgw_obj(pool.get_pool(), oid);
 }
 
 void RGWSI_RADOS::Obj::init(const rgw_raw_obj& obj)
index 14c78a86bec5019664967ca2013836e125fad838..fe666e8f1b0eafd6125ca11db8c88b60879d3aef 100644 (file)
@@ -100,6 +100,10 @@ public:
     int lookup();
     int open(ceph::optional_ref_default<RGWSI_RADOS::OpenParams> params = std::nullopt);
 
+    const rgw_pool& get_pool() {
+      return pool;
+    }
+
     librados::IoCtx& ioctx() {
       return state.ioctx;
     }
@@ -152,7 +156,7 @@ public:
       init(_obj);
     }
 
-    Obj(Pool& pool, const rgw_raw_obj& obj);
+    Obj(Pool& pool, const string& oid);
 
   public:
     Obj() {}
@@ -209,8 +213,8 @@ public:
     return Obj(this, o);
   }
 
-  Obj obj(Pool& pool, const rgw_raw_obj& o) {
-    return Obj(pool, o);
+  Obj obj(Pool& pool, const string& oid) {
+    return Obj(pool, oid);
   }
 
   Pool pool() {
index 931029b402b0f28c7ce0678cbae350d251f6d952..4146af67ea016ef150d851df1aa4c2a1e47ae601 100644 (file)
@@ -105,5 +105,10 @@ public:
   virtual int flush_bucket_stats(RGWSI_MetaBackend::Context *ctx,
                                  const rgw_user& user,
                                  const RGWBucketEnt& ent) = 0;
+  virtual int complete_flush_stats(RGWSI_MetaBackend::Context *ctx,
+                                  const rgw_user& user) = 0;
+  virtual int reset_bucket_stats(RGWSI_MetaBackend::Context *ctx,
+                                const rgw_user& user) = 0;
+  virtual int read_stats(const rgw_user& user, RGWStorageStats *stats) = 0;
 };
 
index 77b1895344cde45299b3c14fba348d6ddfa33d97..3e647ca56826a910dea6d9eea15fd61e59f9d1dd 100644 (file)
@@ -766,3 +766,69 @@ int RGWSI_User_RADOS::flush_bucket_stats(RGWSI_MetaBackend::Context *ctx,
   return cls_user_flush_bucket_stats(obj, ent);
 }
 
+int RGWSI_User_RADOS::reset_bucket_stats(RGWSI_MetaBackend::Context *ctx,
+                                         const rgw_user& user) override
+{
+  return cls_user_reset_stats(user);
+}
+
+int RGWSI_User_RADOS::cls_user_reset_stats(const rgw_user& user)
+{
+  rgw_raw_obj obj = get_buckets_obj(user);
+  auto rados_obj = svc.rados->obj(obj);
+  int r = rados_obj.open();
+  if (r < 0) {
+    return r;
+  }
+  librados::ObjectWriteOperation op;
+  ::cls_user_reset_stats(op);
+  return rados_obj->operate(&op, null_yield);
+}
+
+int RGWSI_User_RADOS::complete_flush_stats(RGWSI_MetaBackend::Context *ctx,
+                                           const rgw_user& user)
+{
+  rgw_raw_obj obj = get_buckets_obj(user);
+  auto rados_obj = svc.rados->obj(obj);
+  int r = rados_obj.open();
+  if (r < 0) {
+    return r;
+  }
+  librados::ObjectWriteOperation op;
+  ::cls_user_complete_stats_sync(op);
+  return rados_obj->operate(&op, null_yield);
+}
+
+int RGWSI_User_RADOS::cls_user_get_header(const rgw_user& user, cls_user_header *header)
+{
+  rgw_raw_obj obj = get_buckets_obj(user);
+  auto rados_obj = svc.rados->obj(obj);
+  int r = rados_obj.open();
+  if (r < 0) {
+    return r;
+  }
+  int rc;
+  bufferlist ibl;
+  librados::ObjectReadOperation op;
+  ::cls_user_get_header(op, header, &rc);
+  return rados_obj->operate(&op, &ibl, null_yield);
+}
+
+int RGWSI_User_RADOS::read_stats(const rgw_user& user, RGWStorageStats *stats)
+{
+  string user_str = user.to_str();
+
+  cls_user_header header;
+  int r = cls_user_get_header(user_str, &header);
+  if (r < 0)
+    return r;
+
+  const cls_user_stats& hs = header.stats;
+
+  stats->size = hs.total_bytes;
+  stats->size_rounded = hs.total_bytes_rounded;
+  stats->num_objects = hs.total_entries;
+
+  return 0;
+}
+
index cd61f4f2c02c6fa2aa229f08cd5f3f1584b08501..fe4d0e76d8fc779d4f458818760f4c060a0d7e4d 100644 (file)
@@ -86,6 +86,9 @@ class RGWSI_User_RADOS : public RGWSI_User
                             string * const out_marker,
                             bool * const truncated);
 
+  int cls_user_reset_stats(const rgw_user& user);
+  int cls_user_get_header(const rgw_user& user, cls_user_header *header);
+
   int do_start() override;
 public:
   struct Svc {
@@ -170,5 +173,12 @@ public:
   int flush_bucket_stats(RGWSI_MetaBackend::Context *ctx,
                          const rgw_user& user,
                          const RGWBucketEnt& ent) override;
+
+  int complete_flush_stats(RGWSI_MetaBackend::Context *ctx,
+                          const rgw_user& user) override;
+
+  int reset_bucket_stats(RGWSI_MetaBackend::Context *ctx,
+                        const rgw_user& user) override;
+  int read_stats(const rgw_user& user, RGWStorageStats *stats) override;
 };
 
index 4200e4733d174f47bb6ed1f73b1701e896b63b63..54fecd9cae46527dd050464e5be38ab28a92879d 100644 (file)
@@ -887,6 +887,13 @@ bool RGWSI_Zone::find_zone_id_by_name(const string& name, string *id) {
   return true;
 }
 
+bool RGWSI_Zone::need_to_sync() const
+{
+  return !(zonegroup.master_zone.empty() ||
+          !rest_master_conn ||
+          current_period.get_id().empty());
+}
+
 bool RGWSI_Zone::need_to_log_data() const
 {
   return zone_public_config->log_data;
index 1672d6d94487c3f09c9542e178f3e1f9bfc6b3e0..66f6d61376c01fa05114d11dd40eed972f15ae91 100644 (file)
@@ -119,6 +119,7 @@ public:
 
   bool is_meta_master() const;
 
+  bool need_to_sync() const;
   bool need_to_log_data() const;
   bool need_to_log_metadata() const;
   bool can_reshard() const;