]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: fetch_remote_obj() preserves RGW_ATTR_COMPRESSION of encrypted objects
authorCasey Bodley <cbodley@redhat.com>
Wed, 28 Jun 2023 18:57:49 +0000 (14:57 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 3 Jul 2023 16:12:32 +0000 (12:12 -0400)
if the source object was both compressed and encrypted, preserve its
original compression attribute so it can be decompressed the same way it
was originally compressed

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit b91ff3fd86f52f7148daf7f9acc9864752186ce0)

src/rgw/driver/rados/rgw_rados.cc

index caf6e70bf17aef43abee8b77c73ab764da9e9acb..69323f571a27e6a28695ebd533b08956b6c2e3b2 100644 (file)
@@ -3393,8 +3393,12 @@ public:
         try_etag_verify = false;
       }
 
+      // if the object is both compressed and encrypted, it was transferred
+      // in its encrypted+compressed form. we need to preserve the original
+      // RGW_ATTR_COMPRESSION instead of falling back to default compression
+      // settings
       auto iter = src_attrs.find(RGW_ATTR_COMPRESSION);
-      if (iter != src_attrs.end()) {
+      if (iter != src_attrs.end() && !encrypted) {
         const bufferlist bl = std::move(iter->second);
         src_attrs.erase(iter); // don't preserve source compression info