Skip to content

Commit 1a7902c

Browse files
authored
Merge pull request ceph#55076 from linuxbox2/wip-rgw-cksum
rgw: implement S3 additional checksum support
2 parents e884e3a + 18ab9f5 commit 1a7902c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1877
-192
lines changed

.gitmodules

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,10 @@
7575
[submodule "src/qatzip"]
7676
path = src/qatzip
7777
url = https://github.com/intel/qatzip.git
78+
[submodule "src/boost_redis"]
79+
path = src/boost_redis
80+
url = https://github.com/boostorg/redis.git
81+
[submodule "src/BLAKE3"]
82+
path = src/BLAKE3
83+
url = https://github.com/BLAKE3-team/BLAKE3.git
84+

src/BLAKE3

Submodule BLAKE3 added at 92e4cd7

src/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ if(HAS_GLIBCXX_ASSERTIONS AND CMAKE_BUILD_TYPE STREQUAL Debug)
196196
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-D_GLIBCXX_ASSERTIONS>)
197197
endif()
198198

199+
# add BLAKE3 before we clobber CMAKE_ASM_COMPILER
200+
add_subdirectory(BLAKE3/c EXCLUDE_FROM_ALL)
201+
199202
include(SIMDExt)
200203
if(HAVE_INTEL)
201204
if(APPLE)

src/common/ceph_crypto.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ namespace TOPNSPC::crypto {
9191
SHA512 () : OpenSSLDigest(EVP_sha512()) { }
9292
};
9393

94-
9594
# if OPENSSL_VERSION_NUMBER < 0x10100000L
9695
class HMAC {
9796
private:

src/rgw/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ set(librgw_common_srcs
7070
rgw_bucket.cc
7171
rgw_bucket_layout.cc
7272
rgw_cache.cc
73+
rgw_cksum_pipe.cc
7374
rgw_common.cc
7475
rgw_compression.cc
7576
rgw_cors.cc
@@ -304,7 +305,8 @@ target_link_libraries(rgw_common
304305
RapidJSON::RapidJSON
305306
Boost::context
306307
${FMT_LIB}
307-
OpenSSL::SSL)
308+
OpenSSL::SSL
309+
BLAKE3::blake3)
308310
target_include_directories(rgw_common
309311
PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw/services"
310312
PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw"

src/rgw/driver/d4n/rgw_sal_d4n.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,7 @@ int D4NFilterWriter::process(bufferlist&& data, uint64_t offset)
811811
int D4NFilterWriter::complete(size_t accounted_size, const std::string& etag,
812812
ceph::real_time *mtime, ceph::real_time set_mtime,
813813
std::map<std::string, bufferlist>& attrs,
814+
const std::optional<rgw::cksum::Cksum>& cksum,
814815
ceph::real_time delete_at,
815816
const char *if_match, const char *if_nomatch,
816817
const std::string *user_data,
@@ -830,7 +831,7 @@ int D4NFilterWriter::complete(size_t accounted_size, const std::string& etag,
830831
ldpp_dout(save_dpp, 10) << "D4NFilterWriter::" << __func__ << "(): ObjectDirectory set method failed." << dendl;
831832

832833
/* Retrieve complete set of attrs */
833-
int ret = next->complete(accounted_size, etag, mtime, set_mtime, attrs,
834+
int ret = next->complete(accounted_size, etag, mtime, set_mtime, attrs, cksum,
834835
delete_at, if_match, if_nomatch, user_data, zones_trace,
835836
canceled, rctx, flags);
836837
obj->get_obj_attrs(rctx.y, save_dpp, NULL);

src/rgw/driver/d4n/rgw_sal_d4n.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,15 @@ class D4NFilterWriter : public FilterWriter {
219219
virtual int prepare(optional_yield y);
220220
virtual int process(bufferlist&& data, uint64_t offset) override;
221221
virtual int complete(size_t accounted_size, const std::string& etag,
222-
ceph::real_time *mtime, ceph::real_time set_mtime,
223-
std::map<std::string, bufferlist>& attrs,
224-
ceph::real_time delete_at,
225-
const char *if_match, const char *if_nomatch,
226-
const std::string *user_data,
227-
rgw_zone_set *zones_trace, bool *canceled,
228-
const req_context& rctx,
229-
uint32_t flags) override;
222+
ceph::real_time *mtime, ceph::real_time set_mtime,
223+
std::map<std::string, bufferlist>& attrs,
224+
const std::optional<rgw::cksum::Cksum>& cksum,
225+
ceph::real_time delete_at,
226+
const char *if_match, const char *if_nomatch,
227+
const std::string *user_data,
228+
rgw_zone_set *zones_trace, bool *canceled,
229+
const req_context& rctx,
230+
uint32_t flags) override;
230231
bool is_atomic() { return atomic; };
231232
const DoutPrefixProvider* dpp() { return save_dpp; }
232233
};

src/rgw/driver/daos/rgw_sal_daos.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,6 +1596,7 @@ int DaosMultipartUpload::init(const DoutPrefixProvider* dpp, optional_yield y,
15961596

15971597
multipart_upload_info upload_info;
15981598
upload_info.dest_placement = dest_placement;
1599+
upload_info.cksum_type = cksum_type;
15991600

16001601
ent.encode(bl);
16011602
encode(attrs, bl);
@@ -1968,6 +1969,7 @@ int DaosMultipartUpload::get_info(const DoutPrefixProvider* dpp,
19681969

19691970
// Now decode the placement rule
19701971
decode(upload_info, iter);
1972+
cksum_type = upload_info.cksum_type;
19711973
placement = upload_info.dest_placement;
19721974
*rule = &placement;
19731975

src/rgw/driver/daos/rgw_sal_daos.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,7 @@ class DaosAtomicWriter : public StoreWriter {
742742
virtual int complete(size_t accounted_size, const std::string& etag,
743743
ceph::real_time* mtime, ceph::real_time set_mtime,
744744
std::map<std::string, bufferlist>& attrs,
745+
const std::optional<rgw::cksum::Cksum>& cksum,
745746
ceph::real_time delete_at, const char* if_match,
746747
const char* if_nomatch, const std::string* user_data,
747748
rgw_zone_set* zones_trace, bool* canceled,
@@ -788,6 +789,7 @@ class DaosMultipartWriter : public StoreWriter {
788789
virtual int complete(size_t accounted_size, const std::string& etag,
789790
ceph::real_time* mtime, ceph::real_time set_mtime,
790791
std::map<std::string, bufferlist>& attrs,
792+
const std::optional<rgw::cksum::Cksum>& cksum,
791793
ceph::real_time delete_at, const char* if_match,
792794
const char* if_nomatch, const std::string* user_data,
793795
rgw_zone_set* zones_trace, bool* canceled,
@@ -810,6 +812,10 @@ class DaosMultipartPart : public StoreMultipartPart {
810812
virtual const std::string& get_etag() { return info.etag; }
811813
virtual ceph::real_time& get_mtime() { return info.modified; }
812814

815+
virtual const std::optional<rgw::cksum::Cksum>& get_cksum() {
816+
return info.cksum;
817+
}
818+
813819
friend class DaosMultipartUpload;
814820
};
815821

src/rgw/driver/motr/rgw_sal_motr.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@ class MotrAtomicWriter : public StoreWriter {
791791
virtual int complete(size_t accounted_size, const std::string& etag,
792792
ceph::real_time *mtime, ceph::real_time set_mtime,
793793
std::map<std::string, bufferlist>& attrs,
794+
const std::optional<rgw::cksum::Cksum>& cksum,
794795
ceph::real_time delete_at,
795796
const char *if_match, const char *if_nomatch,
796797
const std::string *user_data,
@@ -839,6 +840,7 @@ class MotrMultipartWriter : public StoreWriter {
839840
virtual int complete(size_t accounted_size, const std::string& etag,
840841
ceph::real_time *mtime, ceph::real_time set_mtime,
841842
std::map<std::string, bufferlist>& attrs,
843+
const std::optional<rgw::cksum::Cksum>& cksum,
842844
ceph::real_time delete_at,
843845
const char *if_match, const char *if_nomatch,
844846
const std::string *user_data,
@@ -888,6 +890,9 @@ class MotrMultipartPart : public StoreMultipartPart {
888890
virtual uint64_t get_size() { return info.accounted_size; }
889891
virtual const std::string& get_etag() { return info.etag; }
890892
virtual ceph::real_time& get_mtime() { return info.modified; }
893+
virtual const std::optional<rgw::cksum::Cksum>& get_cksum() {
894+
return info.cksum;
895+
}
891896

892897
RGWObjManifest& get_manifest() { return info.manifest; }
893898

0 commit comments

Comments
 (0)