From: Yehuda Sadeh Date: Wed, 16 Jan 2019 03:36:22 +0000 (-0800) Subject: rgw: fetch_remote_obj(): set compression_type inside callback X-Git-Tag: v14.1.0~314^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=055aebe72f01bb938d0b2ca811d78e4ff60af569;p=ceph.git rgw: fetch_remote_obj(): set compression_type inside callback The tail_rule is being determined at the callback, not before. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index a283a9efb5a5..5bbc9f5fd33f 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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;