From: Sage Weil Date: Mon, 30 Dec 2013 17:04:40 +0000 (-0800) Subject: ceph_test_rados: is_dirty on non-flushing objects only X-Git-Tag: v0.77~22^2~23 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=55b83f16d25cc0bfcca17ed933e69f4f994daa97;p=ceph.git ceph_test_rados: is_dirty on non-flushing objects only 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 --- diff --git a/src/test/osd/RadosModel.h b/src/test/osd/RadosModel.h index fa881ebba7d1..eeeb5ef15d88 100644 --- a/src/test/osd/RadosModel.h +++ b/src/test/osd/RadosModel.h @@ -152,6 +152,8 @@ public: map > pool_obj_cont; set oid_in_use; set oid_not_in_use; + set oid_flushing; + set oid_not_flushing; SharedPtrRegistry 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) { diff --git a/src/test/osd/TestRados.cc b/src/test/osd/TestRados.cc index 23f93939cd10..c555dcdf72cf 100644 --- a/src/test/osd/TestRados.cc +++ b/src/test/osd/TestRados.cc @@ -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); }