From 15e97d7307156ff4eef00b127fad2b0223628e5b Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 13 Sep 2012 14:42:06 -0700 Subject: [PATCH] cls_rgw: complete_op() only skip update if epoch is non zero 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 --- src/cls/rgw/cls_rgw.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index a5b98d01b01f1..f9b7c93054d09 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -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; } -- 2.39.5