summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-05-09 21:07:43 -0700
committerYehuda Sadeh <yehuda@inktank.com>2013-05-09 21:08:24 -0700
commit8b3cd6e74b2bdc437480b9976a6286cec088dceb (patch)
tree9404bed3756f5c142c986cd40eff55379e616374
parent0557e6c1027ac5f08d8d2f93c2fc443de4df6ce4 (diff)
downloadceph-8b3cd6e74b2bdc437480b9976a6286cec088dceb.tar.gz
rgw: don't handle ECANCELLED anymore
Simplify, remove obsolete logic. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/rgw/rgw_rados.cc36
1 files changed, 1 insertions, 35 deletions
diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc
index 7b4606652ec..b213ddac9f3 100644
--- a/src/rgw/rgw_rados.cc
+++ b/src/rgw/rgw_rados.cc
@@ -2653,14 +2653,6 @@ int RGWRados::set_attr(void *ctx, rgw_obj& obj, const char *name, bufferlist& bl
if (state && r >= 0)
state->attrset[name] = bl;
- if (r == -ECANCELED) {
- /* a race! object was replaced, we need to set attr on the original obj */
- ldout(cct, 0) << "NOTICE: RGWRados::set_attr: raced with another process, going to the shadow obj instead" << dendl;
- string loc = obj.loc();
- rgw_obj shadow(obj.bucket, state->shadow_obj, loc, shadow_ns);
- r = set_attr(NULL, shadow, name, bl);
- }
-
if (r < 0)
return r;
@@ -2719,15 +2711,6 @@ int RGWRados::set_attrs(void *ctx, rgw_obj& obj,
return 0;
r = io_ctx.operate(actual_obj, &op);
-
- if (r == -ECANCELED) {
- /* a race! object was replaced, we need to set attr on the original obj */
- ldout(cct, 0) << "NOTICE: RGWRados::set_obj_attrs: raced with another process, going to the shadow obj instead" << dendl;
- string loc = obj.loc();
- rgw_obj shadow(obj.bucket, state->shadow_obj, loc, shadow_ns);
- r = set_attrs(NULL, shadow, attrs, rmattrs);
- }
-
if (r < 0)
return r;
@@ -3219,15 +3202,6 @@ int RGWRados::get_obj(void *ctx, RGWObjVersionTracker *objv_tracker, void **hand
r = state->io_ctx.operate(oid, &op, NULL);
ldout(cct, 20) << "rados->read r=" << r << " bl.length=" << bl.length() << dendl;
- if (r == -ECANCELED) {
- /* a race! object was replaced, we need to set attr on the original obj */
- ldout(cct, 0) << "NOTICE: RGWRados::get_obj: raced with another process, going to the shadow obj instead" << dendl;
- string loc = obj.loc();
- rgw_obj shadow(bucket, astate->shadow_obj, loc, shadow_ns);
- r = get_obj(NULL, NULL, handle, shadow, bl, ofs, end);
- goto done_ret;
- }
-
if (merge_bl)
bl.append(read_bl);
@@ -3684,15 +3658,7 @@ int RGWRados::read(void *ctx, rgw_obj& obj, off_t ofs, size_t size, bufferlist&
op.read(ofs, size, &bl, NULL);
- r = io_ctx.operate(oid, &op, NULL);
- if (r == -ECANCELED) {
- /* a race! object was replaced, we need to set attr on the original obj */
- ldout(cct, 0) << "NOTICE: RGWRados::get_obj: raced with another process, going to the shadow obj instead" << dendl;
- string loc = obj.loc();
- rgw_obj shadow(obj.bucket, astate->shadow_obj, loc, shadow_ns);
- r = read(NULL, shadow, ofs, size, bl);
- }
- return r;
+ return io_ctx.operate(oid, &op, NULL);
}
int RGWRados::obj_stat(void *ctx, rgw_obj& obj, uint64_t *psize, time_t *pmtime, uint64_t *epoch, map<string, bufferlist> *attrs, bufferlist *first_chunk,