]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls_rgw: complete_op() only skip update if epoch is non zero
authorYehuda Sadeh <yehuda@inktank.com>
Thu, 13 Sep 2012 21:42:06 +0000 (14:42 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Tue, 18 Sep 2012 19:57:05 +0000 (12:57 -0700)
An update shouldn't be skipped if epoch is zero. We'd see a zero
epoch if we tried to read an object and it didn't exist. That
could happen e.g., when a delete object operation failed to
call the complete earlier, and now we're recalling delete on
the (now non-existent object).
However, note that the zero epoch is racy. We may end up racing
with an object creation. This will be taken care of by a new
rados change that will set the returned object version even if
it didn't exist.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/cls/rgw/cls_rgw.cc

index a5b98d01b01f1d4b1dfd9c7ec35eacece9d514ad..f9b7c93054d0932fcafd0aa476f985a0c0cbe052 100644 (file)
@@ -287,7 +287,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
   if (op.tag.size() && op.op == CLS_RGW_OP_CANCEL) {
     CLS_LOG(1, "rgw_bucket_complete_op(): cancel requested\n");
     cancel = true;
-  } else if (op.epoch <= entry.epoch) {
+  } else if (op.epoch && op.epoch <= entry.epoch) {
     CLS_LOG(1, "rgw_bucket_complete_op(): skipping request, old epoch\n");
     cancel = true;
   }