]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_test_rados: fix COPY_FROM completion 614/head
authorSage Weil <sage@inktank.com>
Sat, 21 Sep 2013 04:06:09 +0000 (21:06 -0700)
committerSage Weil <sage@inktank.com>
Sat, 21 Sep 2013 04:06:09 +0000 (21:06 -0700)
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>
src/test/osd/RadosModel.h

index f8dc8b6a906e0416b5500902d623e146395b989e..ab0b13d73e4cea9b6a487d9f631636af8a5500fa 100644 (file)
@@ -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()