From f1ed1e0b6df095e0fb9f730433d0d0544ab58e3b Mon Sep 17 00:00:00 2001 From: Samarah Date: Fri, 7 Jun 2024 17:24:15 +0000 Subject: [PATCH] d4n: Comment out `copy` directory unit tests and remove unnecessary `copy_object` implementation in filter Signed-off-by: Samarah --- src/rgw/driver/d4n/d4n_directory.cc | 2 + src/rgw/driver/d4n/rgw_sal_d4n.cc | 99 ----------------------------- src/rgw/driver/d4n/rgw_sal_d4n.h | 16 ----- src/test/rgw/test_d4n_directory.cc | 4 ++ 4 files changed, 6 insertions(+), 115 deletions(-) diff --git a/src/rgw/driver/d4n/d4n_directory.cc b/src/rgw/driver/d4n/d4n_directory.cc index 35b34a2c1d9..1fd9437691d 100644 --- a/src/rgw/driver/d4n/d4n_directory.cc +++ b/src/rgw/driver/d4n/d4n_directory.cc @@ -171,6 +171,7 @@ int ObjectDirectory::get(CacheObj* object, optional_yield y) return 0; } +/* Note: This method is not compatible for use on Ubuntu systems. */ int ObjectDirectory::copy(CacheObj* object, std::string copyName, std::string copyBucketName, optional_yield y) { std::string key = build_index(object); @@ -475,6 +476,7 @@ int BlockDirectory::get(CacheBlock* block, optional_yield y) return 0; } +/* Note: This method is not compatible for use on Ubuntu systems. */ int BlockDirectory::copy(CacheBlock* block, std::string copyName, std::string copyBucketName, optional_yield y) { std::string key = build_index(block); diff --git a/src/rgw/driver/d4n/rgw_sal_d4n.cc b/src/rgw/driver/d4n/rgw_sal_d4n.cc index 3b6124478a0..7c6d10f5af8 100644 --- a/src/rgw/driver/d4n/rgw_sal_d4n.cc +++ b/src/rgw/driver/d4n/rgw_sal_d4n.cc @@ -110,105 +110,6 @@ int D4NFilterBucket::create(const DoutPrefixProvider* dpp, return next->create(dpp, params, y); } -int D4NFilterObject::copy_object(const ACLOwner& owner, - const rgw_user& remote_user, - req_info* info, - const rgw_zone_id& source_zone, - rgw::sal::Object* dest_object, - rgw::sal::Bucket* dest_bucket, - rgw::sal::Bucket* src_bucket, - const rgw_placement_rule& dest_placement, - ceph::real_time* src_mtime, - ceph::real_time* mtime, - const ceph::real_time* mod_ptr, - const ceph::real_time* unmod_ptr, - bool high_precision_time, - const char* if_match, - const char* if_nomatch, - AttrsMod attrs_mod, - bool copy_if_newer, - Attrs& attrs, - RGWObjCategory category, - uint64_t olh_epoch, - boost::optional delete_at, - std::string* version_id, - std::string* tag, - std::string* etag, - void (*progress_cb)(off_t, void *), - void* progress_data, - const DoutPrefixProvider* dpp, - optional_yield y) -{ - rgw::d4n::CacheObj obj = rgw::d4n::CacheObj{ - .objName = this->get_key().get_oid(), - .bucketName = src_bucket->get_name() - }; - - if (driver->get_obj_dir()->copy(&obj, dest_object->get_name(), dest_bucket->get_name(), y) < 0) - ldpp_dout(dpp, 10) << "D4NFilterObject::" << __func__ << "(): BlockDirectory copy method failed." << dendl; - - /* Append additional metadata to attributes */ - rgw::sal::Attrs baseAttrs = this->get_attrs(); - buffer::list bl; - - bl.append(to_iso_8601(*mtime)); - baseAttrs.insert({"mtime", bl}); - bl.clear(); - - if (version_id != NULL) { - bl.append(*version_id); - baseAttrs.insert({"version_id", bl}); - bl.clear(); - } - - if (!etag->empty()) { - bl.append(*etag); - baseAttrs.insert({"etag", bl}); - bl.clear(); - } - - if (attrs_mod == rgw::sal::ATTRSMOD_REPLACE) { /* Replace */ - rgw::sal::Attrs::iterator iter; - - for (const auto& pair : attrs) { - iter = baseAttrs.find(pair.first); - - if (iter != baseAttrs.end()) { - iter->second = pair.second; - } else { - baseAttrs.insert({pair.first, pair.second}); - } - } - } else if (attrs_mod == rgw::sal::ATTRSMOD_MERGE) { /* Merge */ - baseAttrs.insert(attrs.begin(), attrs.end()); - } - - /* - int copy_attrsReturn = driver->get_cache_driver()->copy_attrs(this->get_key().get_oid(), dest_object->get_key().get_oid(), &baseAttrs); - - if (copy_attrsReturn < 0) { - ldpp_dout(dpp, 20) << "D4N Filter: Cache copy attributes operation failed." << dendl; - } else { - int copy_dataReturn = driver->get_cache_driver()->copy_data(this->get_key().get_oid(), dest_object->get_key().get_oid()); - - if (copy_dataReturn < 0) { - ldpp_dout(dpp, 20) << "D4N Filter: Cache copy data operation failed." << dendl; - } else { - ldpp_dout(dpp, 20) << "D4N Filter: Cache copy object operation succeeded." << dendl; - } - }*/ - - return next->copy_object(owner, remote_user, info, source_zone, - nextObject(dest_object), - nextBucket(dest_bucket), - nextBucket(src_bucket), - dest_placement, src_mtime, mtime, - mod_ptr, unmod_ptr, high_precision_time, if_match, - if_nomatch, attrs_mod, copy_if_newer, attrs, - category, olh_epoch, delete_at, version_id, tag, - etag, progress_cb, progress_data, dpp, y); -} - int D4NFilterObject::set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattrs, Attrs* delattrs, optional_yield y) { diff --git a/src/rgw/driver/d4n/rgw_sal_d4n.h b/src/rgw/driver/d4n/rgw_sal_d4n.h index 42436b92d1d..2eff3cb18a3 100644 --- a/src/rgw/driver/d4n/rgw_sal_d4n.h +++ b/src/rgw/driver/d4n/rgw_sal_d4n.h @@ -177,22 +177,6 @@ class D4NFilterObject : public FilterObject { driver(_driver) {} virtual ~D4NFilterObject() = default; - virtual int copy_object(const ACLOwner& owner, - const rgw_user& remote_user, - req_info* info, const rgw_zone_id& source_zone, - rgw::sal::Object* dest_object, rgw::sal::Bucket* dest_bucket, - rgw::sal::Bucket* src_bucket, - const rgw_placement_rule& dest_placement, - ceph::real_time* src_mtime, ceph::real_time* mtime, - const ceph::real_time* mod_ptr, const ceph::real_time* unmod_ptr, - bool high_precision_time, - const char* if_match, const char* if_nomatch, - AttrsMod attrs_mod, bool copy_if_newer, Attrs& attrs, - RGWObjCategory category, uint64_t olh_epoch, - boost::optional delete_at, - std::string* version_id, std::string* tag, std::string* etag, - void (*progress_cb)(off_t, void *), void* progress_data, - const DoutPrefixProvider* dpp, optional_yield y) override; virtual const std::string &get_name() const override { return next->get_name(); } virtual int set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattrs, Attrs* delattrs, optional_yield y) override; diff --git a/src/test/rgw/test_d4n_directory.cc b/src/test/rgw/test_d4n_directory.cc index 05ad8399141..fbebcc8e4ab 100644 --- a/src/test/rgw/test_d4n_directory.cc +++ b/src/test/rgw/test_d4n_directory.cc @@ -200,6 +200,7 @@ TEST_F(ObjectDirectoryFixture, GetYield) io.run(); } +/* Does not currently pass on Ubuntu due to incompatible Redis version. TEST_F(ObjectDirectoryFixture, CopyYield) { boost::asio::spawn(io, [this] (boost::asio::yield_context yield) { @@ -230,6 +231,7 @@ TEST_F(ObjectDirectoryFixture, CopyYield) io.run(); } +*/ TEST_F(ObjectDirectoryFixture, DelYield) { @@ -354,6 +356,7 @@ TEST_F(BlockDirectoryFixture, GetYield) io.run(); } +/* Does not currently pass on Ubuntu due to incompatible Redis version. TEST_F(BlockDirectoryFixture, CopyYield) { boost::asio::spawn(io, [this] (boost::asio::yield_context yield) { @@ -384,6 +387,7 @@ TEST_F(BlockDirectoryFixture, CopyYield) io.run(); } +*/ TEST_F(BlockDirectoryFixture, DelYield) { -- 2.39.5