From: Daniel Gryniewicz Date: Wed, 25 Aug 2021 17:02:12 +0000 (-0400) Subject: RGW Zipper - chunk/stripe size are RadosStore only X-Git-Tag: v17.1.0~1011^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F42922%2Fhead;p=ceph.git RGW Zipper - chunk/stripe size are RadosStore only Signed-off-by: Daniel Gryniewicz --- diff --git a/src/rgw/rgw_putobj_processor.cc b/src/rgw/rgw_putobj_processor.cc index d4b600cfe90f2..58cff29802885 100644 --- a/src/rgw/rgw_putobj_processor.cc +++ b/src/rgw/rgw_putobj_processor.cc @@ -212,7 +212,8 @@ int AtomicObjectProcessor::prepare(optional_yield y) uint64_t chunk_size = 0; uint64_t alignment; - int r = head_obj->get_max_chunk_size(dpp, head_obj->get_bucket()->get_placement_rule(), + int r = dynamic_cast(head_obj.get())->get_max_chunk_size( + dpp, head_obj->get_bucket()->get_placement_rule(), &max_head_chunk_size, &alignment); if (r < 0) { return r; @@ -222,7 +223,7 @@ int AtomicObjectProcessor::prepare(optional_yield y) if (head_obj->get_bucket()->get_placement_rule() != tail_placement_rule) { if (!head_obj->placement_rules_match(head_obj->get_bucket()->get_placement_rule(), tail_placement_rule)) { same_pool = false; - r = head_obj->get_max_chunk_size(dpp, tail_placement_rule, &chunk_size); + r = dynamic_cast(head_obj.get())->get_max_chunk_size(dpp, tail_placement_rule, &chunk_size); if (r < 0) { return r; } @@ -238,7 +239,8 @@ int AtomicObjectProcessor::prepare(optional_yield y) uint64_t stripe_size; const uint64_t default_stripe_size = store->ctx()->_conf->rgw_obj_stripe_size; - head_obj->get_max_aligned_size(default_stripe_size, alignment, &stripe_size); + dynamic_cast(head_obj.get())->get_max_aligned_size( + default_stripe_size, alignment, &stripe_size); manifest.set_trivial_rule(head_max_size, stripe_size); @@ -361,12 +363,14 @@ int MultipartObjectProcessor::prepare_head() uint64_t stripe_size; uint64_t alignment; - int r = target_obj->get_max_chunk_size(dpp, tail_placement_rule, &chunk_size, &alignment); + int r = dynamic_cast(target_obj.get())->get_max_chunk_size(dpp, + tail_placement_rule, &chunk_size, &alignment); if (r < 0) { ldpp_dout(dpp, 0) << "ERROR: unexpected: get_max_chunk_size(): placement_rule=" << tail_placement_rule.to_str() << " obj=" << target_obj << " returned r=" << r << dendl; return r; } - target_obj->get_max_aligned_size(default_stripe_size, alignment, &stripe_size); + dynamic_cast(target_obj.get())->get_max_aligned_size( + default_stripe_size, alignment, &stripe_size); manifest.set_multipart_part_rule(stripe_size, part_num); diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index 2ee306a512191..b1b9922f8bd10 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -704,11 +704,6 @@ class Object { uint64_t olh_epoch, const DoutPrefixProvider* dpp, optional_yield y) = 0; - virtual int get_max_chunk_size(const DoutPrefixProvider* dpp, - rgw_placement_rule placement_rule, - uint64_t* max_chunk_size, - uint64_t* alignment = nullptr) = 0; - virtual void get_max_aligned_size(uint64_t size, uint64_t alignment, uint64_t* max_size) = 0; virtual bool placement_rules_match(rgw_placement_rule& r1, rgw_placement_rule& r2) = 0; virtual int get_obj_layout(const DoutPrefixProvider *dpp, optional_yield y, Formatter* f, RGWObjectCtx* obj_ctx) = 0; diff --git a/src/rgw/rgw_sal_rados.h b/src/rgw/rgw_sal_rados.h index f1c73c39745c2..d7472886d7612 100644 --- a/src/rgw/rgw_sal_rados.h +++ b/src/rgw/rgw_sal_rados.h @@ -171,11 +171,6 @@ class RadosObject : public Object { uint64_t olh_epoch, const DoutPrefixProvider* dpp, optional_yield y) override; - virtual int get_max_chunk_size(const DoutPrefixProvider* dpp, - rgw_placement_rule placement_rule, - uint64_t* max_chunk_size, - uint64_t* alignment = nullptr) override; - virtual void get_max_aligned_size(uint64_t size, uint64_t alignment, uint64_t* max_size) override; virtual bool placement_rules_match(rgw_placement_rule& r1, rgw_placement_rule& r2) override; virtual int get_obj_layout(const DoutPrefixProvider *dpp, optional_yield y, Formatter* f, RGWObjectCtx* obj_ctx) override; @@ -204,6 +199,11 @@ class RadosObject : public Object { bool must_exist, optional_yield y) override; /* Internal to RadosStore */ + int get_max_chunk_size(const DoutPrefixProvider* dpp, + rgw_placement_rule placement_rule, + uint64_t* max_chunk_size, + uint64_t* alignment = nullptr); + void get_max_aligned_size(uint64_t size, uint64_t alignment, uint64_t* max_size); void raw_obj_to_obj(const rgw_raw_obj& raw_obj); private: