From 39c0e121e8a76b8f2197ff4199a8ad9b3a3c906b Mon Sep 17 00:00:00 2001 From: Daniel Gryniewicz Date: Wed, 25 Aug 2021 13:02:12 -0400 Subject: [PATCH] RGW Zipper - chunk/stripe size are RadosStore only Signed-off-by: Daniel Gryniewicz --- src/rgw/rgw_putobj_processor.cc | 14 +++++++++----- src/rgw/rgw_sal.h | 5 ----- src/rgw/rgw_sal_rados.h | 10 +++++----- 3 files changed, 14 insertions(+), 15 deletions(-) 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: -- 2.39.5