]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: handle racing object puts when object doesn't exist
authorYehuda Sadeh <yehuda@inktank.com>
Thu, 16 Jan 2014 19:45:27 +0000 (11:45 -0800)
committerYehuda Sadeh <yehuda@inktank.com>
Tue, 28 Jan 2014 20:24:32 +0000 (12:24 -0800)
commitba792cdc8d0c006e260e6a02a33ca1491b35901c
tree5d7df1c069f842f9865beb496e8ee45fe225cc0d
parent1e2984ac4a4ed0508e1b5efc8b69ae4da0cac824
rgw: handle racing object puts when object doesn't exist

If the object didn't exist before and now we have multiple puts coming
in concurrently, we need to make sure that we behave correctly. Only one
needs to win, the other one can fail silently. We do that by setting
exclusive flag on the object creation and handling the error correctly.
Note that we still want to return -EEXIST in some cases (when the
exclusive flag is passed to put_obj_meta(), e.g., on bucket creation).

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 86c15480fc3e33b9a3b84d0af68d8398fc732bae)
src/rgw/rgw_rados.cc