]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw : Issue AIO for next chunk first before flush the (cached) data. 4505/head
authorGuang Yang <yguang@yahoo-inc.com>
Fri, 3 Apr 2015 12:27:04 +0000 (12:27 +0000)
committerLoic Dachary <ldachary@redhat.com>
Wed, 29 Apr 2015 19:04:09 +0000 (21:04 +0200)
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 <yguang@yahoo-inc.com>
(cherry picked from commit 366e8a85c0e9f00eed364eaebbfb6b672852eae9)

src/rgw/rgw_rados.cc

index 604d4cb8ba715761fb26d86e4452fe0d38982929..49f88e6ca73fdf2256ab1a326d05ceea16839086 100644 (file)
@@ -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: