]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
RadosModel: randomly prefix delete with assert_exists
authorSamuel Just <sjust@redhat.com>
Thu, 21 May 2015 19:13:43 +0000 (12:13 -0700)
committerAbhishek Lekshmanan <abhishek.lekshmanan@ril.com>
Mon, 8 Jun 2015 17:49:34 +0000 (23:19 +0530)
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 4fe7d2abdff2fce359e5e992206644cc03825ee0)

src/test/osd/RadosModel.h

index 9192c5dd19d2b18fe36d1ed68a9bb42480bef43c..8d6889edb4c1b180c2db077c45a3fbd07e128545 100644 (file)
@@ -944,7 +944,15 @@ public:
     interval_set<uint64_t> ranges;
     context->state_lock.Unlock();
 
-    int r = context->io_ctx.remove(context->prefix+oid);
+    int r = 0;
+    if (rand() % 2) {
+      librados::ObjectWriteOperation op;
+      op.assert_exists();
+      op.remove();
+      r = context->io_ctx.operate(context->prefix+oid, &op);
+    } else {
+      r = context->io_ctx.remove(context->prefix+oid);
+    }
     if (r && !(r == -ENOENT && !present)) {
       cerr << "r is " << r << " while deleting " << oid << " and present is " << present << std::endl;
       assert(0);