From: Sage Weil Date: Fri, 10 Jan 2014 19:12:48 +0000 (-0800) Subject: ceph_test_rados: do not delete in-use snaps X-Git-Tag: v0.77~22^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b5ae76e8fe64f0ec76524c2852ae04c42db6efaf;p=ceph.git ceph_test_rados: do not delete in-use snaps There are a bunch of ops that read from snaps. Do not delete a snap while they are in use. Signed-off-by: Sage Weil --- diff --git a/src/test/osd/RadosModel.h b/src/test/osd/RadosModel.h index 2f24d2744757..97cfd786dbc7 100644 --- a/src/test/osd/RadosModel.h +++ b/src/test/osd/RadosModel.h @@ -985,6 +985,8 @@ public: ObjectDesc old_value; int snap; + std::tr1::shared_ptr in_use; + bufferlist result; int retval; @@ -1016,6 +1018,7 @@ public: context->state_lock.Lock(); if (!(rand() % 4) && !context->snaps.empty()) { snap = rand_choose(context->snaps)->first; + in_use = context->snaps_in_use.lookup_or_create(snap, snap); } else { snap = -1; } @@ -1430,6 +1433,7 @@ public: librados::ObjectReadOperation rd_op; librados::AioCompletion *comp; librados::AioCompletion *comp_racing_read; + std::tr1::shared_ptr in_use; int snap; int done; uint64_t version; @@ -1460,6 +1464,7 @@ public: // choose source snap if (0 && !(rand() % 4) && !context->snaps.empty()) { snap = rand_choose(context->snaps)->first; + in_use = context->snaps_in_use.lookup_or_create(snap, snap); } else { snap = -1; } @@ -1693,6 +1698,7 @@ public: bool dirty; ObjectDesc old_value; int snap; + std::tr1::shared_ptr in_use; IsDirtyOp(int n, RadosTestContext *context, @@ -1711,6 +1717,7 @@ public: if (!(rand() % 4) && !context->snaps.empty()) { snap = rand_choose(context->snaps)->first; + in_use = context->snaps_in_use.lookup_or_create(snap, snap); } else { snap = -1; } @@ -1787,6 +1794,7 @@ public: bool blocking; int snap; bool can_fail; + std::tr1::shared_ptr in_use; CacheFlushOp(int n, RadosTestContext *context, @@ -1807,6 +1815,7 @@ public: if (!(rand() % 4) && !context->snaps.empty()) { snap = rand_choose(context->snaps)->first; + in_use = context->snaps_in_use.lookup_or_create(snap, snap); } else { snap = -1; } @@ -1894,6 +1903,7 @@ public: librados::AioCompletion *completion; librados::ObjectReadOperation op; string oid; + std::tr1::shared_ptr in_use; CacheEvictOp(int n, RadosTestContext *context, @@ -1911,6 +1921,7 @@ public: int snap; if (!(rand() % 4) && !context->snaps.empty()) { snap = rand_choose(context->snaps)->first; + in_use = context->snaps_in_use.lookup_or_create(snap, snap); } else { snap = -1; }