]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks: add a blacklist for flush_pg_stats()
authorKefu Chai <kchai@redhat.com>
Fri, 2 Jun 2017 06:41:26 +0000 (14:41 +0800)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 17:06:50 +0000 (13:06 -0400)
so we don't wait for marked out osds.

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/ceph_manager.py
qa/tasks/osd_recovery.py

index 1fceb9b95290ab0b4e7b99df575d6a2d162f011e..99d6221637d9954eef22fabf1c3ff97cb0cd4758 100644 (file)
@@ -1148,12 +1148,17 @@ class CephManager:
                   "-w"],
             wait=False, stdout=StringIO(), stdin=run.PIPE)
 
-    def flush_pg_stats(self, osds, wait_for_mon=3*5):
+    def flush_pg_stats(self, osds, no_wait=None, wait_for_mon=3*5):
         """
         Flush pg stats from a list of OSD ids, ensuring they are reflected
         all the way to the monitor.  Luminous and later only.
 
         :param osds: list of OSDs to flush
+        :param no_wait: list of OSDs not to wait for seq id. by default, we
+                        wait for all specified osds, but some of them could be
+                        moved out of osdmap, so we cannot get their updated
+                        stat seq from monitor anymore. in that case, you need
+                        to pass a blacklist.
         :param wait_for_mon: wait for mon to be synced with mgr. 0 to disable
                              it. (3 * mon_mgr_digest_period, by default)
         """
@@ -1161,7 +1166,11 @@ class CephManager:
                for osd in osds}
         if not wait_for_mon:
             return
+        if no_wait is None:
+            no_wait = []
         for osd, need in seq.iteritems():
+            if osd in no_wait:
+                continue
             got = 0
             while wait_for_mon > 0:
                 got = self.raw_cluster_cmd('osd', 'last-stat-seq', 'osd.%d' % osd)
index 02a1cc1ba924347dbff1c86fd972162f563a543e..41e86d6555bf50f0b15f4840ed7387472f253b41 100644 (file)
@@ -141,7 +141,7 @@ def test_incomplete_pgs(ctx, config):
 
     # move data off of osd.0, osd.1
     manager.raw_cluster_cmd('osd', 'out', '0', '1')
-    manager.flush_pg_stats([0, 1, 2, 3])
+    manager.flush_pg_stats([0, 1, 2, 3], [0, 1])
     manager.wait_for_clean()
 
     # lots of objects in rbd (no pg log, will backfill)
@@ -160,7 +160,7 @@ def test_incomplete_pgs(ctx, config):
     manager.raw_cluster_cmd('osd', 'in', '0', '1')
     manager.raw_cluster_cmd('osd', 'out', '2', '3')
     time.sleep(10)
-    manager.flush_pg_stats([0, 1, 2, 3])
+    manager.flush_pg_stats([0, 1, 2, 3], [2, 3])
     time.sleep(10)
     manager.wait_for_active()