From 0bd837a47a6713cd80b5e231d72f593bfe02b9e3 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 13 Sep 2019 14:44:31 -0400 Subject: [PATCH] rgw: disable compression/encryption on Appendable objects Signed-off-by: Casey Bodley (cherry picked from commit bf49aff3a12dbeeefc92c579d1fb230deb5cf459) --- doc/radosgw/s3/objectops.rst | 1 + src/rgw/rgw_op.cc | 31 +++++++++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/doc/radosgw/s3/objectops.rst b/doc/radosgw/s3/objectops.rst index 37a65c130ce..e0c0c0e1af4 100644 --- a/doc/radosgw/s3/objectops.rst +++ b/doc/radosgw/s3/objectops.rst @@ -410,6 +410,7 @@ It is used to upload files in appending mode. The type of the objects created by operation is Appendable Object, and the type of the objects uploaded with the Put Object operation is Normal Object. **Append Object can't be used if bucket versioning is enabled or suspended.** **Synced object will become normal in multisite, but you can still append to the original object.** +**Compression and encryption features are disabled for Appendable objects.** Syntax diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index a88f43853e3..7cab79084f9 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -3737,20 +3737,23 @@ void RGWPutObj::execute() boost::optional compressor; std::unique_ptr encrypt; - op_ret = get_encrypt_filter(&encrypt, filter); - if (op_ret < 0) { - return; - } - if (encrypt != nullptr) { - filter = &*encrypt; - } else if (compression_type != "none") { - plugin = get_compressor_plugin(s, compression_type); - if (!plugin) { - ldpp_dout(this, 1) << "Cannot load plugin for compression type " - << compression_type << dendl; - } else { - compressor.emplace(s->cct, plugin, filter); - filter = &*compressor; + + if (!append) { // compression and encryption only apply to full object uploads + op_ret = get_encrypt_filter(&encrypt, filter); + if (op_ret < 0) { + return; + } + if (encrypt != nullptr) { + filter = &*encrypt; + } else if (compression_type != "none") { + plugin = get_compressor_plugin(s, compression_type); + if (!plugin) { + ldpp_dout(this, 1) << "Cannot load plugin for compression type " + << compression_type << dendl; + } else { + compressor.emplace(s->cct, plugin, filter); + filter = &*compressor; + } } } tracepoint(rgw_op, before_data_transfer, s->req_id.c_str()); -- 2.47.3