]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw : Issue AIO for next chunk first before flush the (cached) data. 4268/head
authorGuang Yang <yguang@yahoo-inc.com>
Fri, 3 Apr 2015 12:27:04 +0000 (12:27 +0000)
committerGuang Yang <yguang@yahoo-inc.com>
Fri, 3 Apr 2015 12:27:04 +0000 (12:27 +0000)
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>
src/rgw/rgw_rados.cc

index 5183747aff33b62292de14d4f438bd900a9f37cc..449ee388b8ca34248da699f11bfe2c6647607b7d 100644 (file)
@@ -5677,10 +5677,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);
@@ -5704,6 +5700,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: