summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-09-10 12:18:55 -0700
committerYehuda Sadeh <yehuda@inktank.com>2013-09-18 11:40:56 -0700
commita855aba9d18936e9a060119e041518790cd4b831 (patch)
tree9e0f9132ea3b34de47f7b51ae34465966c211a0a
parent670db7e80ddc9c26c43a4f66907a5996ce207c4d (diff)
downloadceph-a855aba9d18936e9a060119e041518790cd4b831.tar.gz
rgw: drain pending requests before completing write
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)
-rw-r--r--src/rgw/rgw_rados.cc5
-rw-r--r--src/rgw/rgw_rados.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc
index 0c2119ecf9d..d79fbe4c943 100644
--- a/src/rgw/rgw_rados.cc
+++ b/src/rgw/rgw_rados.cc
@@ -761,6 +761,11 @@ int RGWPutObjProcessor_Atomic::complete_writing_data()
}
}
complete_parts();
+
+ int r = drain_pending();
+ if (r < 0)
+ return r;
+
return 0;
}
diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h
index ef98ec1f9fb..a55f1c1f94c 100644
--- a/src/rgw/rgw_rados.h
+++ b/src/rgw/rgw_rados.h
@@ -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: