]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: disable compression/encryption on Appendable objects 31026/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 13 Sep 2019 18:44:31 +0000 (14:44 -0400)
committerNathan Cutler <ncutler@suse.com>
Mon, 21 Oct 2019 20:18:52 +0000 (22:18 +0200)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit bf49aff3a12dbeeefc92c579d1fb230deb5cf459)

doc/radosgw/s3/objectops.rst
src/rgw/rgw_op.cc

index 37a65c130ceec0fb8fcd5e363af52e40a41b7a46..e0c0c0e1af453537a361b6727b1a0fe920fbc4f0 100644 (file)
@@ -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
index a88f43853e39f9311810941320c74c887d0e731b..7cab79084f9b0047b9ad708f8aee5059e67f2d57 100644 (file)
@@ -3737,20 +3737,23 @@ void RGWPutObj::execute()
   boost::optional<RGWPutObj_Compress> compressor;
 
   std::unique_ptr<DataProcessor> 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());