From: Sage Weil Date: Thu, 4 Apr 2019 11:41:22 +0000 (-0500) Subject: rgw/rgw_rados: pass mostly_omap flag when opening/creating pools X-Git-Tag: v14.2.3~17^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=50c07745e8de2c7503a27648d6778bafee19d53d;p=ceph.git rgw/rgw_rados: pass mostly_omap flag when opening/creating pools Signed-off-by: Sage Weil (cherry picked from commit c4b830069372302ee93687d417d04ad39f600c4e) --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index e8dc2e138aea..645a29f99c8a 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -5703,7 +5703,7 @@ void RGWCompleteMultipart::execute() store->obj_to_raw((s->bucket_info).placement_rule, meta_obj, &raw_obj); store->get_obj_data_pool((s->bucket_info).placement_rule, meta_obj,&meta_pool); - store->open_pool_ctx(meta_pool, serializer.ioctx); + store->open_pool_ctx(meta_pool, serializer.ioctx, true); op_ret = serializer.try_lock(raw_obj.oid, dur); if (op_ret < 0) { diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 630fd224f6ac..bdea1249c96c 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -938,7 +938,7 @@ RGWDataSyncStatusManager* RGWRados::get_data_sync_manager(const std::string& sou int RGWRados::get_required_alignment(const rgw_pool& pool, uint64_t *alignment) { IoCtx ioctx; - int r = open_pool_ctx(pool, ioctx); + int r = open_pool_ctx(pool, ioctx, false); if (r < 0) { ldout(cct, 0) << "ERROR: open_pool_ctx() returned " << r << dendl; return r; @@ -1669,33 +1669,34 @@ int RGWRados::initialize() */ int RGWRados::open_root_pool_ctx() { - return rgw_init_ioctx(get_rados_handle(), svc.zone->get_zone_params().domain_root, root_pool_ctx, true); + return rgw_init_ioctx(get_rados_handle(), svc.zone->get_zone_params().domain_root, root_pool_ctx, true, true); } int RGWRados::open_gc_pool_ctx() { - return rgw_init_ioctx(get_rados_handle(), svc.zone->get_zone_params().gc_pool, gc_pool_ctx, true); + return rgw_init_ioctx(get_rados_handle(), svc.zone->get_zone_params().gc_pool, gc_pool_ctx, true, true); } int RGWRados::open_lc_pool_ctx() { - return rgw_init_ioctx(get_rados_handle(), svc.zone->get_zone_params().lc_pool, lc_pool_ctx, true); + return rgw_init_ioctx(get_rados_handle(), svc.zone->get_zone_params().lc_pool, lc_pool_ctx, true, true); } int RGWRados::open_objexp_pool_ctx() { - return rgw_init_ioctx(get_rados_handle(), svc.zone->get_zone_params().log_pool, objexp_pool_ctx, true); + return rgw_init_ioctx(get_rados_handle(), svc.zone->get_zone_params().log_pool, objexp_pool_ctx, true, true); } int RGWRados::open_reshard_pool_ctx() { - return rgw_init_ioctx(get_rados_handle(), svc.zone->get_zone_params().reshard_pool, reshard_pool_ctx, true); + return rgw_init_ioctx(get_rados_handle(), svc.zone->get_zone_params().reshard_pool, reshard_pool_ctx, true, true); } -int RGWRados::open_pool_ctx(const rgw_pool& pool, librados::IoCtx& io_ctx) +int RGWRados::open_pool_ctx(const rgw_pool& pool, librados::IoCtx& io_ctx, + bool mostly_omap) { constexpr bool create = true; // create the pool if it doesn't exist - return rgw_init_ioctx(get_rados_handle(), pool, io_ctx, create); + return rgw_init_ioctx(get_rados_handle(), pool, io_ctx, create, mostly_omap); } void RGWRados::build_bucket_index_marker(const string& shard_id_str, const string& shard_marker, @@ -1712,7 +1713,7 @@ int RGWRados::open_bucket_index_ctx(const RGWBucketInfo& bucket_info, librados:: const rgw_pool& explicit_pool = bucket_info.bucket.explicit_placement.index_pool; if (!explicit_pool.empty()) { - return open_pool_ctx(explicit_pool, index_ctx); + return open_pool_ctx(explicit_pool, index_ctx, false); } auto& zonegroup = svc.zone->get_zonegroup(); @@ -1728,7 +1729,7 @@ int RGWRados::open_bucket_index_ctx(const RGWBucketInfo& bucket_info, librados:: return -EINVAL; } - int r = open_pool_ctx(iter->second.index_pool, index_ctx); + int r = open_pool_ctx(iter->second.index_pool, index_ctx, true); if (r < 0) return r; @@ -2900,7 +2901,7 @@ int RGWRados::get_obj_head_ioctx(const RGWBucketInfo& bucket_info, const rgw_obj return -EIO; } - int r = open_pool_ctx(pool, *ioctx); + int r = open_pool_ctx(pool, *ioctx, false); if (r < 0) { return r; } @@ -2920,7 +2921,7 @@ int RGWRados::get_obj_head_ref(const RGWBucketInfo& bucket_info, const rgw_obj& return -EIO; } - int r = open_pool_ctx(pool, ref->ioctx); + int r = open_pool_ctx(pool, ref->ioctx, false); if (r < 0) { return r; } @@ -2940,7 +2941,7 @@ 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); + r = open_pool_ctx(ref->obj.pool, ref->ioctx, false); if (r < 0) return r; @@ -6668,7 +6669,7 @@ int RGWRados::Object::Read::read(int64_t ofs, int64_t end, bufferlist& bl) auto iter = state.io_ctxs.find(read_obj.pool); if (iter == state.io_ctxs.end()) { state.cur_ioctx = &state.io_ctxs[read_obj.pool]; - r = store->open_pool_ctx(read_obj.pool, *state.cur_ioctx); + r = store->open_pool_ctx(read_obj.pool, *state.cur_ioctx, false); if (r < 0) { ldout(cct, 20) << "ERROR: failed to open pool context for pool=" << read_obj.pool << " r=" << r << dendl; return r; @@ -8476,7 +8477,7 @@ int RGWRados::pool_iterate_begin(const rgw_pool& pool, RGWPoolIterCtx& ctx) librados::IoCtx& io_ctx = ctx.io_ctx; librados::NObjectIterator& iter = ctx.iter; - int r = open_pool_ctx(pool, io_ctx); + int r = open_pool_ctx(pool, io_ctx, false); if (r < 0) return r; @@ -8490,7 +8491,7 @@ int RGWRados::pool_iterate_begin(const rgw_pool& pool, const string& cursor, RGW librados::IoCtx& io_ctx = ctx.io_ctx; librados::NObjectIterator& iter = ctx.iter; - int r = open_pool_ctx(pool, io_ctx); + int r = open_pool_ctx(pool, io_ctx, false); if (r < 0) return r; diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 2871f69df889..78f28fa0749b 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -1187,7 +1187,8 @@ class RGWRados : public AdminSocketHook int open_objexp_pool_ctx(); int open_reshard_pool_ctx(); - int open_pool_ctx(const rgw_pool& pool, librados::IoCtx& io_ctx); + int open_pool_ctx(const rgw_pool& pool, librados::IoCtx& io_ctx, + bool mostly_omap); int open_bucket_index_ctx(const RGWBucketInfo& bucket_info, librados::IoCtx& index_ctx); int open_bucket_index(const RGWBucketInfo& bucket_info, librados::IoCtx& index_ctx, string& bucket_oid); int open_bucket_index_base(const RGWBucketInfo& bucket_info, librados::IoCtx& index_ctx, diff --git a/src/rgw/rgw_tools.cc b/src/rgw/rgw_tools.cc index 5b931825f348..fe3284309681 100644 --- a/src/rgw/rgw_tools.cc +++ b/src/rgw/rgw_tools.cc @@ -32,7 +32,8 @@ static std::map* ext_mime_map; int rgw_init_ioctx(librados::Rados *rados, const rgw_pool& pool, - librados::IoCtx& ioctx, bool create) + librados::IoCtx& ioctx, bool create, + bool mostly_omap) { int r = rados->ioctx_create(pool.name.c_str(), ioctx); if (r == -ENOENT && create) { diff --git a/src/rgw/rgw_tools.h b/src/rgw/rgw_tools.h index e30f80868a65..0e8b1621313a 100644 --- a/src/rgw/rgw_tools.h +++ b/src/rgw/rgw_tools.h @@ -18,7 +18,9 @@ class optional_yield; struct obj_version; int rgw_init_ioctx(librados::Rados *rados, const rgw_pool& pool, - librados::IoCtx& ioctx, bool create = false); + librados::IoCtx& ioctx, + bool create = false, + bool mostly_omap = false); int rgw_put_system_obj(RGWRados *rgwstore, const rgw_pool& pool, const string& oid, bufferlist& data, bool exclusive, RGWObjVersionTracker *objv_tracker, real_time set_mtime, map *pattrs = NULL);