From: Sage Weil Date: Sat, 21 Sep 2013 04:06:09 +0000 (-0700) Subject: ceph_test_rados: fix COPY_FROM completion X-Git-Tag: v0.71~103^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2b75abbd850e6988539d79c3ab564e50c09c3812;p=ceph.git ceph_test_rados: fix COPY_FROM completion Fix the copy_from operation to not remove the objects from the in_use list until after the entire operation is complete. In particular, the racing read was completing and removing the dest oid from the in-use list before the copy-from completed. This keeps the model in sync with what the OSD is actually doing. If another new read started up, it would grab the previous value from the model and expect to see that, but would instead see the updated value. Signed-off-by: Sage Weil --- diff --git a/src/test/osd/RadosModel.h b/src/test/osd/RadosModel.h index f8dc8b6a906e0..ab0b13d73e4ce 100644 --- a/src/test/osd/RadosModel.h +++ b/src/test/osd/RadosModel.h @@ -1482,9 +1482,6 @@ public: context->update_object_full(oid, src_value); context->update_object_version(oid, comp->get_version64()); } - context->oid_in_use.erase(oid_src); - context->oid_not_in_use.insert(oid_src); - context->kick(); } else if (info->id == 1) { // racing read assert(comp_racing_read->is_complete()); @@ -1499,11 +1496,14 @@ public: assert(!version || comp_racing_read->get_version64() == version); version = comp_racing_read->get_version64(); } + } + if (++done == 2) { context->oid_in_use.erase(oid); context->oid_not_in_use.insert(oid); + context->oid_in_use.erase(oid_src); + context->oid_not_in_use.insert(oid_src); context->kick(); } - ++done; } bool finished()