]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/mds_flush: use new stray/purge perfcounters
authorJohn Spray <jspray@redhat.com>
Mon, 19 Jan 2015 21:32:50 +0000 (21:32 +0000)
committerJohn Spray <jspray@redhat.com>
Mon, 19 Jan 2015 22:00:53 +0000 (22:00 +0000)
Where previously we only tracked RADOS-level delete
ops during deletion, now also verify that they
correspond to the right number of MDS-level purge
operations.

Signed-off-by: John Spray <john.spray@redhat.com>
tasks/mds_flush.py

index 46c8a69b2f513afcb7acce5d05b6cf4203ca88fd..23282df6d27a60ddbc0cc1092bd015d7992a05d5 100644 (file)
@@ -57,14 +57,19 @@ class TestFlush(CephFSTestCase):
         self.mount_a.wait_until_mounted()
         self.mount_a.run_shell(["rm", "-rf", "mydir"])
 
-        # We will count the deletions to detect completion
-        # FIXME: let's add some MDS perf counters for strays so that we can monitor
-        # deletions directly (#10388)
+        # We will count the RADOS deletions and MDS file purges, to verify that
+        # the expected behaviour is happening as a result of the purge
         initial_dels = self.fs.mds_asok(['perf', 'dump'])['objecter']['osdop_delete']
+        initial_purges = self.fs.mds_asok(['perf', 'dump'])['mds_cache']['strays_purged']
 
         flush_data = self.fs.mds_asok(["flush", "journal"])
         self.assertEqual(flush_data['return_code'], 0)
 
+        # We expect to see a single file purge
+        self.wait_until_true(
+            lambda: self.fs.mds_asok(['perf', 'dump'])['mds_cache']['strays_purged'] - initial_purges >= 1,
+            60)
+
         # We expect two deletions, one of the dirfrag and one of the backtrace
         self.wait_until_true(
             lambda: self.fs.mds_asok(['perf', 'dump'])['objecter']['osdop_delete'] - initial_dels >= 2,