]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't clear olh log if we lost in race
authorYehuda Sadeh <yehuda@redhat.com>
Sat, 24 Jan 2015 01:29:57 +0000 (17:29 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 29 Jan 2015 17:31:33 +0000 (09:31 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rados.cc

index 2e2252e1c9e33e146228e3f5062eabe3d65ba721..b51bf1cf54569e6bcd0f52e85c4eca1b54f2ed86 100644 (file)
@@ -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;
+      }
     }
   }