]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_test_rados_api_tier: scrub while cache tier is missing clones
authorSage Weil <sage@inktank.com>
Thu, 27 Mar 2014 20:28:10 +0000 (13:28 -0700)
committerSage Weil <sage@inktank.com>
Thu, 27 Mar 2014 20:28:10 +0000 (13:28 -0700)
Trigger a scrub to verify that we can handle a cache tier that is missing
some clones.  We rely on the test harness to notice the error, and we do
not confirm that the scrub happened.  In practice this is plenty of time,
however.

Signed-off-by: Sage Weil <sage@inktank.com>
src/test/librados/tier.cc

index 5628465790a36b7d2a15d006bd2ba2452168251e..4bab8958a1fca54261c4a5f4cebd2f71efbb17c4 100644 (file)
@@ -357,6 +357,24 @@ TEST_F(LibRadosTwoPoolsPP, PromoteSnap) {
 
   ioctx.snap_set_read(my_snaps[0]);
 
+  // stop and scrub this pg (to make sure scrub can handle missing
+  // clones in the cache tier)
+  {
+    IoCtx cache_ioctx;
+    ASSERT_EQ(0, cluster.ioctx_create(cache_pool_name.c_str(), cache_ioctx));
+    ostringstream ss;
+    ss << "{\"prefix\": \"pg scrub\", \"pgid\": \""
+       << cache_ioctx.get_id() << "."
+       << ioctx.get_object_pg_hash_position("foo")
+       << "\"}";
+    ASSERT_EQ(0, cluster.mon_command(ss.str(), inbl, NULL, NULL));
+
+    // give it a few seconds to go.  this is sloppy but is usually enough time
+    cout << "waiting for scrub..." << std::endl;
+    sleep(15);
+    cout << "done waiting" << std::endl;
+  }
+
   // read foo snap
   {
     bufferlist bl;