From 2b75abbd850e6988539d79c3ab564e50c09c3812 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 20 Sep 2013 21:06:09 -0700 Subject: [PATCH] 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 --- src/test/osd/RadosModel.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/osd/RadosModel.h b/src/test/osd/RadosModel.h index f8dc8b6a906..ab0b13d73e4 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() -- 2.47.3