]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/tasks/ceph: wait for splits/merges before final scrub
authorSage Weil <sage@redhat.com>
Wed, 19 Dec 2018 13:14:30 +0000 (07:14 -0600)
committerSage Weil <sage@redhat.com>
Wed, 19 Dec 2018 20:37:01 +0000 (14:37 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
qa/tasks/ceph.py

index 56e15e623c66819f40b87e9f81ea9ae37e0fbddc..fcc8dbb3103b6e0b536a13ba92a3f74b667f9a4c 100644 (file)
@@ -1116,12 +1116,15 @@ def osd_scrub_pgs(ctx, config):
     all_clean = False
     for _ in range(0, retries):
         stats = manager.get_pg_stats()
-        bad = [stat['pgid'] for stat in stats if 'active+clean' not in stat['state']]
-        if not bad:
+        unclean = [stat['pgid'] for stat in stats if 'active+clean' not in stat['state']]
+        split_merge = []
+        osd_dump = manager.get_osd_dump_json()
+        split_merge = [i['pool_name'] for i in osd_dump['pools'] if i['pg_num'] != i['pg_num_target']]
+        if not unclean and not split_merge:
             all_clean = True
             break
         log.info(
-            "Waiting for all PGs to be active and clean, waiting on %s" % bad)
+            "Waiting for all PGs to be active+clean and split+merged, waiting on %s to go clean and/or %s to split/merge" % (unclean, split_merge))
         time.sleep(delays)
     if not all_clean:
         raise RuntimeError("Scrubbing terminated -- not all pgs were active and clean.")