]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: cut short object read if a chunk returns error
authorYehuda Sadeh <yehuda@inktank.com>
Tue, 6 May 2014 18:06:29 +0000 (11:06 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Mon, 9 Jun 2014 17:41:15 +0000 (10:41 -0700)
Fixes: #8289
Backport: firefly, dumpling
When reading an object, if we hit an error when trying to read one of
the rados objects then we should just stop. Otherwise we're just going
to continue reading the rest of the object, and since it can't be sent
back to the client (as we have a hole in the middle), we end up
accumulating everything in memory.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 03b0d1cfb7bd30a77fedcf75eb06476b21b14e95)

src/rgw/rgw_rados.cc

index 256bfd753d2e6dee8232ca4b27400c8652e2a8d1..5c55f2b6e75bf484a9e9356adde7856f52c24743 100644 (file)
@@ -4303,8 +4303,16 @@ void RGWRados::get_obj_aio_completion_cb(completion_t c, void *arg)
   ldout(cct, 20) << "get_obj_aio_completion_cb: io completion ofs=" << ofs << " len=" << len << dendl;
   d->throttle.put(len);
 
-  if (d->is_cancelled())
+  r = rados_aio_get_return_value(c);
+  if (r < 0) {
+    ldout(cct, 0) << "ERROR: got unexpected error when trying to read object: " << r << dendl;
+    d->set_cancelled(r);
     goto done;
+  }
+
+  if (d->is_cancelled()) {
+    goto done;
+  }
 
   d->data_lock.Lock();