From: Kajetan Janiak Date: Wed, 18 Nov 2020 10:42:07 +0000 (+0100) Subject: rgw: disable prefetch in rgw_file X-Git-Tag: v15.2.16~65^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F44170%2Fhead;p=ceph.git rgw: disable prefetch in rgw_file Each call to rgw_read (rgw_file.cc) invokes three calls to RGWRados::get_obj_state with s->prefetch_data=true. It results in great read amplification. If length argument in rgw_read call is smaller than rgw_max_chunk_size, then the amplification is threefold. Signed-off-by: Kajetan Janiak (cherry picked from commit f915e21e5a1baf6030c1407b3058d4f58c638df9) Conflicts: src/rgw/rgw_op.cc Cherry-pick notes: - Octopus sets prfetch data flag through Rados method vs. method on object --- diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index 32449721ea1..ac8ada0251f 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -2164,6 +2164,8 @@ public: return 0; } + bool prefetch_data() override { return false; } + }; /* RGWReadRequest */ /* diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index ec0dbf64361..7dc50a6ce1c 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -966,7 +966,7 @@ int RGWGetObj::verify_permission() { obj = rgw_obj(s->bucket, s->object); store->getRados()->set_atomic(s->obj_ctx, obj); - if (get_data) { + if (prefetch_data()) { store->getRados()->set_prefetch_data(s->obj_ctx, obj); }