]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_test_rados: is_dirty on non-flushing objects only
authorSage Weil <sage@inktank.com>
Mon, 30 Dec 2013 17:04:40 +0000 (09:04 -0800)
committerSage Weil <sage@inktank.com>
Tue, 14 Jan 2014 00:19:45 +0000 (16:19 -0800)
This makes its results reliable.  Otherwise, we can't mix the is_dirty
test with flush, which eliminates much of its value.

Signed-off-by: Sage Weil <sage@inktank.com>
src/test/osd/RadosModel.h
src/test/osd/TestRados.cc

index fa881ebba7d1f5a6da36d342ac1e155f2fff96f9..eeeb5ef15d88d033d3c7655b242fb887aab73cf3 100644 (file)
@@ -152,6 +152,8 @@ public:
   map<int, map<string,ObjectDesc> > pool_obj_cont;
   set<string> oid_in_use;
   set<string> oid_not_in_use;
+  set<string> oid_flushing;
+  set<string> oid_not_flushing;
   SharedPtrRegistry<int, int> snaps_in_use;
   int current_snap;
   string pool_name;
@@ -1824,6 +1826,8 @@ public:
     // leave object in unused list so that we race with other operations
     //context->oid_in_use.insert(oid);
     //context->oid_not_in_use.erase(oid);
+    context->oid_flushing.insert(oid);
+    context->oid_not_flushing.erase(oid);
     context->state_lock.Unlock();
 
     unsigned flags = librados::OPERATION_IGNORE_CACHE;
@@ -1849,6 +1853,8 @@ public:
     assert(completion->is_complete());
     //context->oid_in_use.erase(oid);
     //context->oid_not_in_use.insert(oid);
+    context->oid_flushing.erase(oid);
+    context->oid_not_flushing.insert(oid);
     int r = completion->get_return_value();
     cout << num << ":  got " << cpp_strerror(r) << std::endl;
     if (r == 0) {
index 23f93939cd109fa2de94e2476914be9c0ceebdee..c555dcdf72cf2a5d822baa146248ba099c1f97ed 100644 (file)
@@ -49,6 +49,7 @@ public:
       stringstream oid;
       oid << m_op;
       cout << m_op << ": write initial oid " << oid.str() << std::endl;
+      context.oid_not_flushing.insert(oid.str());
       return new WriteOp(m_op, &context, oid.str());
     } else if (m_op >= m_ops) {
       return NULL;
@@ -178,7 +179,7 @@ private:
 
     case TEST_OP_IS_DIRTY:
       {
-       oid = *(rand_choose(context.oid_not_in_use));
+       oid = *(rand_choose(context.oid_not_flushing));
        cout << "is_dirty oid " << oid << std::endl;
        return new IsDirtyOp(m_op, &context, oid, m_stats);
       }