]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_test_rados: order racing read wrt to the COPY_FROM 632/head
authorSage Weil <sage@inktank.com>
Tue, 24 Sep 2013 18:59:17 +0000 (11:59 -0700)
committerSage Weil <sage@inktank.com>
Tue, 24 Sep 2013 19:48:09 +0000 (12:48 -0700)
The prevents:

 - send COPY_FROM, blocks on recovering object
 - send stat, procedes to return old object version
 - COPY_FROM succeeds with new version
   -> fail

Signed-off-by: Sage Weil <sage@inktank.com>
src/test/osd/RadosModel.h

index ab0b13d73e4cea9b6a487d9f631636af8a5500fa..7bda0fe9a564e0507f1116def178ecc4357a7f0c 100644 (file)
@@ -1402,6 +1402,7 @@ public:
   string oid, oid_src;
   ObjectDesc src_value;
   librados::ObjectWriteOperation op;
+  librados::ObjectReadOperation rd_op;
   librados::AioCompletion *comp;
   librados::AioCompletion *comp_racing_read;
   int snap;
@@ -1456,7 +1457,11 @@ public:
                                               new TestOp::CallbackInfo(1));
     comp_racing_read = context->rados.aio_create_completion((void*) read_cb_arg, &write_callback,
                                                            NULL);
-    context->io_ctx.aio_stat(context->prefix+oid, comp_racing_read, NULL, NULL);
+    rd_op.stat(NULL, NULL, NULL);
+    context->io_ctx.aio_operate(context->prefix+oid, comp_racing_read, &rd_op,
+                               librados::SNAP_HEAD,
+                               librados::OPERATION_ORDER_READS_WRITES,  // order wrt previous write/update
+                               NULL);
   }
 
   void _finish(CallbackInfo *info)