]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fetch_remote_obj(): set compression_type inside callback
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 16 Jan 2019 03:36:22 +0000 (19:36 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Wed, 16 Jan 2019 03:36:22 +0000 (19:36 -0800)
The tail_rule is being determined at the callback, not before.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rados.cc

index a283a9efb5a54c9add5eed5c134cdc215561065f..5bbc9f5fd33f98af7c0c2b812ca5577f3730245c 100644 (file)
@@ -4302,6 +4302,14 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
                           ptail_rule = &dest_bucket_info.placement_rule;
                         }
                       }
+                      const auto& compression_type = svc.zone->get_zone_params().get_compression_type(*ptail_rule);
+                      if (compression_type != "none") {
+                        plugin = Compressor::create(cct, compression_type);
+                        if (!plugin) {
+                          ldout(cct, 1) << "Cannot load plugin for compression type "
+                                        << compression_type << dendl;
+                        }
+                      }
 
                       int ret = processor.prepare();
                       if (ret < 0) {
@@ -4310,16 +4318,6 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
                       return 0;
                     });
 
-  const auto& compression_type = svc.zone->get_zone_params().get_compression_type(
-      *ptail_rule);
-  if (compression_type != "none") {
-    plugin = Compressor::create(cct, compression_type);
-    if (!plugin) {
-      ldout(cct, 1) << "Cannot load plugin for compression type "
-          << compression_type << dendl;
-    }
-  }
-
   string etag;
   real_time set_mtime;