From: Sage Weil Date: Tue, 24 Sep 2013 18:59:17 +0000 (-0700) Subject: ceph_test_rados: order racing read wrt to the COPY_FROM X-Git-Tag: v0.71~75^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F632%2Fhead;p=ceph.git ceph_test_rados: order racing read wrt to the COPY_FROM 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 --- diff --git a/src/test/osd/RadosModel.h b/src/test/osd/RadosModel.h index ab0b13d73e4c..7bda0fe9a564 100644 --- a/src/test/osd/RadosModel.h +++ b/src/test/osd/RadosModel.h @@ -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)