From 963e8c05b762d3e32a37e4ec965c30f096cb64a0 Mon Sep 17 00:00:00 2001 From: Soumya Koduri Date: Sat, 31 Jul 2021 18:30:04 +0530 Subject: [PATCH] rgw/dbstore: Fix DBstore build conflicts Fixing build conflicts with latest sal multipart/writer changes. Also enable WITH_RADOSGW_DBSTORE option by default. Signed-off-by: Soumya Koduri --- CMakeLists.txt | 2 +- src/rgw/rgw_sal_dbstore.cc | 56 +++++++++++++++++++++++++++++++++----- src/rgw/rgw_sal_dbstore.h | 35 +++++++++++++++++++++--- 3 files changed, 81 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c44ea33b14611..0350131765570 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -400,7 +400,7 @@ option(WITH_RADOSGW_BEAST_OPENSSL "Rados Gateway's Beast frontend uses OpenSSL" option(WITH_RADOSGW_AMQP_ENDPOINT "Rados Gateway's pubsub support for AMQP push endpoint" ON) option(WITH_RADOSGW_KAFKA_ENDPOINT "Rados Gateway's pubsub support for Kafka push endpoint" ON) option(WITH_RADOSGW_LUA_PACKAGES "Rados Gateway's support for dynamically adding lua packagess" ON) -option(WITH_RADOSGW_DBSTORE "DBStore backend for Rados Gateway" OFF) +option(WITH_RADOSGW_DBSTORE "DBStore backend for Rados Gateway" ON) if(WITH_RADOSGW) find_package(EXPAT REQUIRED) diff --git a/src/rgw/rgw_sal_dbstore.cc b/src/rgw/rgw_sal_dbstore.cc index f6a35068d8b40..4eda3c5cf228b 100644 --- a/src/rgw/rgw_sal_dbstore.cc +++ b/src/rgw/rgw_sal_dbstore.cc @@ -145,6 +145,13 @@ namespace rgw::sal { return ret; } + int DBBucket::remove_bucket_bypass_gc(int concurrent_max, bool + keep_index_consistent, + optional_yield y, const + DoutPrefixProvider *dpp) { + return 0; + } + int DBBucket::get_bucket_info(const DoutPrefixProvider *dpp, optional_yield y) { int ret = 0; @@ -335,6 +342,23 @@ namespace rgw::sal { return 0; } + int DBBucket::list_multiparts(const DoutPrefixProvider *dpp, + const string& prefix, + string& marker, + const string& delim, + const int& max_uploads, + vector>& uploads, + map *common_prefixes, + bool *is_truncated) { + return 0; + } + + int DBBucket::abort_multiparts(const DoutPrefixProvider *dpp, + CephContext *cct, + string& prefix, string& delim) { + return 0; + } + void DBStore::finalize(void) { if (dbsm) @@ -437,6 +461,31 @@ namespace rgw::sal { return 0; } + std::unique_ptr DBStore::get_multipart_upload(Bucket* bucket, const std::string& oid, std::optional upload_id, ceph::real_time mtime) { + return nullptr; + } + + std::unique_ptr DBStore::get_append_writer(const DoutPrefixProvider *dpp, + optional_yield y, + std::unique_ptr _head_obj, + const rgw_user& owner, RGWObjectCtx& obj_ctx, + const rgw_placement_rule *ptail_placement_rule, + const std::string& unique_tag, + uint64_t position, + uint64_t *cur_accounted_size) { + return nullptr; + } + + std::unique_ptr DBStore::get_atomic_writer(const DoutPrefixProvider *dpp, + optional_yield y, + std::unique_ptr _head_obj, + const rgw_user& owner, RGWObjectCtx& obj_ctx, + const rgw_placement_rule *ptail_placement_rule, + uint64_t olh_epoch, + const std::string& unique_tag) { + return nullptr; + } + std::unique_ptr DBStore::get_user(const rgw_user &u) { return std::unique_ptr(new DBUser(this, u)); @@ -693,13 +742,6 @@ namespace rgw::sal { return 0; } - std::unique_ptr DBStore::get_writer(Aio *aio, rgw::sal::Bucket* bucket, - RGWObjectCtx& obj_ctx, std::unique_ptr _head_obj, - const DoutPrefixProvider *dpp, optional_yield y) - { - return 0; - } - int DBStore::delete_raw_obj(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj) { return 0; diff --git a/src/rgw/rgw_sal_dbstore.h b/src/rgw/rgw_sal_dbstore.h index 6ab0af0b72acd..e5d584f1f92f0 100644 --- a/src/rgw/rgw_sal_dbstore.h +++ b/src/rgw/rgw_sal_dbstore.h @@ -122,6 +122,10 @@ namespace rgw { namespace sal { virtual int list(const DoutPrefixProvider *dpp, ListParams&, int, ListResults&, optional_yield y) override; Object* create_object(const rgw_obj_key& key /* Attributes */) override; virtual int remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, std::string prefix, std::string delimiter, bool forward_to_master, req_info* req_info, optional_yield y) override; + virtual int remove_bucket_bypass_gc(int concurrent_max, bool + keep_index_consistent, + optional_yield y, const + DoutPrefixProvider *dpp) override; virtual RGWAccessControlPolicy& get_acl(void) override { return acls; } virtual int set_acl(const DoutPrefixProvider *dpp, RGWAccessControlPolicy& acl, optional_yield y) override; virtual int get_bucket_info(const DoutPrefixProvider *dpp, optional_yield y) override; @@ -155,6 +159,17 @@ namespace rgw { namespace sal { virtual std::unique_ptr clone() override { return std::make_unique(*this); } + virtual int list_multiparts(const DoutPrefixProvider *dpp, + const string& prefix, + string& marker, + const string& delim, + const int& max_uploads, + vector>& uploads, + map *common_prefixes, + bool *is_truncated) override; + virtual int abort_multiparts(const DoutPrefixProvider *dpp, + CephContext *cct, + string& prefix, string& delim) override; friend class DBStore; }; @@ -288,9 +303,6 @@ namespace rgw { namespace sal { virtual std::unique_ptr get_notification(rgw::sal::Object* obj, struct req_state* s, rgw::notify::EventType event_type, const std::string* object_name=nullptr) override; virtual std::unique_ptr get_gc_chain(rgw::sal::Object* obj) override; - virtual std::unique_ptr get_writer(Aio *aio, rgw::sal::Bucket* bucket, - RGWObjectCtx& obj_ctx, std::unique_ptr _head_obj, - const DoutPrefixProvider *dpp, optional_yield y) override; virtual RGWLC* get_rgwlc(void) override { return NULL; } virtual RGWCoroutinesManagerRegistry* get_cr_registry() override { return NULL; } virtual int delete_raw_obj(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj) override; @@ -345,7 +357,22 @@ namespace rgw { namespace sal { virtual int get_oidc_providers(const DoutPrefixProvider *dpp, const std::string& tenant, vector>& providers) override; - + virtual std::unique_ptr get_multipart_upload(Bucket* bucket, const std::string& oid, std::optional upload_id, ceph::real_time mtime) override; + virtual std::unique_ptr get_append_writer(const DoutPrefixProvider *dpp, + optional_yield y, + std::unique_ptr _head_obj, + const rgw_user& owner, RGWObjectCtx& obj_ctx, + const rgw_placement_rule *ptail_placement_rule, + const std::string& unique_tag, + uint64_t position, + uint64_t *cur_accounted_size) override; + virtual std::unique_ptr get_atomic_writer(const DoutPrefixProvider *dpp, + optional_yield y, + std::unique_ptr _head_obj, + const rgw_user& owner, RGWObjectCtx& obj_ctx, + const rgw_placement_rule *ptail_placement_rule, + uint64_t olh_epoch, + const std::string& unique_tag) override; virtual void finalize(void) override; -- 2.39.5