diff options
author | Sage Weil <sage@inktank.com> | 2013-09-20 21:06:09 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-09-20 21:06:09 -0700 |
commit | 2b75abbd850e6988539d79c3ab564e50c09c3812 (patch) | |
tree | 4ec180154f38d72f493e9c4c61f0798b0846ad65 | |
parent | 935eb22833f1e9e659bbec2350a4fcbc88bdcc9d (diff) | |
download | ceph-2b75abbd850e6988539d79c3ab564e50c09c3812.tar.gz |
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 <sage@inktank.com>
-rw-r--r-- | src/test/osd/RadosModel.h | 8 |
1 files 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() |