From: Yehuda Sadeh Date: Sat, 24 Jan 2015 01:29:57 +0000 (-0800) Subject: rgw: don't clear olh log if we lost in race X-Git-Tag: v0.93~156^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2e3f75fb078d8dd29d1082f2ec328fecfa896cf2;p=ceph.git rgw: don't clear olh log if we lost in race Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 2e2252e1c9e3..b51bf1cf5456 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -6075,12 +6075,15 @@ int RGWRados::apply_olh_log(RGWObjectCtx& obj_ctx, RGWObjState& state, RGWBucket r = ref.ioctx.operate(ref.oid, &rm_op); if (r == -ECANCELED) { return 0; /* someone else won this race */ - } - - r = bucket_index_clear_olh(state, obj); - if (r < 0) { - ldout(cct, 0) << "ERROR: could not clear bucket index olh entries r=" << r << dendl; - return r; + } else { + /* + * only clear if was successful, otherwise we might clobber pending operations on this object + */ + r = bucket_index_clear_olh(state, obj); + if (r < 0) { + ldout(cct, 0) << "ERROR: could not clear bucket index olh entries r=" << r << dendl; + return r; + } } }