From: Guang Yang Date: Fri, 3 Apr 2015 12:27:04 +0000 (+0000) Subject: rgw : Issue AIO for next chunk first before flush the (cached) data. X-Git-Tag: v0.94.2~37^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4505%2Fhead;p=ceph.git rgw : Issue AIO for next chunk first before flush the (cached) data. When handling GET request for large object (with multiple chunks), currently it will first flush the cached data, and then issue AIO request for next chunk, this has the potential issue to make the retriving from OSD and sending to client serialized. This patch switch the two operations. Fixes: 11322 Signed-off-by: Guang Yang (cherry picked from commit 366e8a85c0e9f00eed364eaebbfb6b672852eae9) --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 604d4cb8ba71..49f88e6ca73f 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -5702,10 +5702,6 @@ int RGWRados::get_obj_iterate_cb(RGWObjectCtx *ctx, RGWObjState *astate, } } - r = flush_read_list(d); - if (r < 0) - return r; - get_obj_bucket_and_oid_loc(obj, bucket, oid, key); d->throttle.get(len); @@ -5729,6 +5725,11 @@ int RGWRados::get_obj_iterate_cb(RGWObjectCtx *ctx, RGWObjState *astate, if (r < 0) goto done_err; + // Flush data to client if there is any + r = flush_read_list(d); + if (r < 0) + return r; + return 0; done_err: