]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: require zonegroup feature to compress encrypted objects
authorCasey Bodley <cbodley@redhat.com>
Mon, 3 Jul 2023 19:00:17 +0000 (15:00 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 7 Jul 2023 18:00:36 +0000 (14:00 -0400)
Reef adds support for combining server-side encryption and compression,
but previous releases would not replicate such objects correctly. gate
the feature behind a zonegroup feature flag to require that all zones
upgrade to reef before enabling. this feature is not enabled by default
in new zonegroups

Fixes: https://tracker.ceph.com/issues/57905
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_op.cc
src/rgw/rgw_zone_features.h

index 77adef88c748d0b0e176c815541508ea8194ab1b..80c2894ed662dab82f796ca280b3e72598816ffb 100644 (file)
@@ -4199,7 +4199,11 @@ void RGWPutObj::execute(optional_yield y)
     if (encrypt != nullptr) {
       filter = &*encrypt;
     }
-    if (compression_type != "none") {
+    // a zonegroup feature is required to combine compression and encryption
+    const RGWZoneGroup& zonegroup = s->penv.site->get_zonegroup();
+    const bool compress_encrypted = zonegroup.supports(rgw::zone_features::compress_encrypted);
+    if (compression_type != "none" &&
+        (encrypt == nullptr || compress_encrypted)) {
       plugin = get_compressor_plugin(s, compression_type);
       if (!plugin) {
         ldpp_dout(this, 1) << "Cannot load plugin for compression type "
index 7e47f8cf4a749d261bc09976cef5ef5ad5b54f25..5e1a435d488e49c98bf5f2f29e1f62bcd043eeaf 100644 (file)
@@ -14,10 +14,12 @@ namespace rgw::zone_features {
 
 // zone feature names
 inline constexpr std::string_view resharding = "resharding";
+inline constexpr std::string_view compress_encrypted = "compress-encrypted";
 
 // static list of features supported by this release
 inline constexpr std::initializer_list<std::string_view> supported = {
   resharding,
+  compress_encrypted,
 };
 
 inline constexpr bool supports(std::string_view feature) {