]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: drain pending requests before completing write
authorYehuda Sadeh <yehuda@inktank.com>
Tue, 10 Sep 2013 19:18:55 +0000 (12:18 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Wed, 18 Sep 2013 18:40:56 +0000 (11:40 -0700)
Fixes: #6268
When doing aio write of objects (either regular or multipart parts) we
need to drain pending aio requests. Otherwise if gateway goes down then
object might end up corrupted.

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 626669afaa333d73707553a85f5c874e99e9cbd8)

src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 0c2119ecf9db40e8363c9f5ab5debf073ee19b57..d79fbe4c943c233163c60fca8c07037be2a296d3 100644 (file)
@@ -761,6 +761,11 @@ int RGWPutObjProcessor_Atomic::complete_writing_data()
     }
   }
   complete_parts();
+
+  int r = drain_pending();
+  if (r < 0)
+    return r;
+
   return 0;
 }
 
index ef98ec1f9fbdb88044622d1bd271424e6a540512..a55f1c1f94cf4c80f5738b2a8f576b5a40667102 100644 (file)
@@ -238,11 +238,11 @@ class RGWPutObjProcessor_Aio : public RGWPutObjProcessor
   struct put_obj_aio_info pop_pending();
   int wait_pending_front();
   bool pending_has_completed();
-  int drain_pending();
 
 protected:
   uint64_t obj_len;
 
+  int drain_pending();
   int handle_obj_data(rgw_obj& obj, bufferlist& bl, off_t ofs, off_t abs_ofs, void **phandle);
 
 public: