]> git.apps.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>
Tue, 11 Jul 2023 14:02:06 +0000 (10:02 -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>
(cherry picked from commit 4bc52954ab7b38a8eac50c116196d6db728cee00)

Conflicts:
src/rgw/rgw_op.cc: SiteConfig -> sal::ZoneGroup::supports

src/rgw/rgw_op.cc
src/rgw/rgw_zone_features.h

index b9715e6b2bd31163c49cfef96e6ca02f3ce166d6..79d7e93969444b5ceac908776942b38b91b730bf 100644 (file)
@@ -4182,7 +4182,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 rgw::sal::ZoneGroup& zonegroup = driver->get_zone()->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) {