]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/ceph: only re-request scrub on unscrubbed pgs 32988/head
authorSage Weil <sage@redhat.com>
Thu, 30 Jan 2020 16:22:49 +0000 (10:22 -0600)
committerSage Weil <sage@redhat.com>
Thu, 30 Jan 2020 16:22:49 +0000 (10:22 -0600)
If we haven't scrubbed everything, we occasinoally re-request scrub in case
the request was missed by the OSD (this can happen).  But we were
re-requesting scrub on ALL pgs, and if they are done in a
semi-deterministic order and are slow, then we may never get to the final
ones.

Signed-off-by: Sage Weil <sage@redhat.com>
qa/tasks/ceph.py

index d18366bcff4d0e12c7709352b7d8e44dd176b0b0..00cdd74d0df2f6d9bb01a9be535eb91050d38743 100644 (file)
@@ -1295,6 +1295,7 @@ def osd_scrub_pgs(ctx, config):
         timez = [(stat['pgid'],stat['last_scrub_stamp']) for stat in stats]
         loop = False
         thiscnt = 0
+        re_scrub = []
         for (pgid, tmval) in timez:
             t = tmval[0:tmval.find('.')].replace(' ', 'T')
             pgtm = time.strptime(t, '%Y-%m-%dT%H:%M:%S')
@@ -1303,13 +1304,14 @@ def osd_scrub_pgs(ctx, config):
             else:
                 log.info('pgid %s last_scrub_stamp %s %s <= %s', pgid, tmval, pgtm, check_time_now)
                 loop = True
+                re_scrub.append(pgid)
         if thiscnt > prev_good:
             prev_good = thiscnt
             gap_cnt = 0
         else:
             gap_cnt += 1
             if gap_cnt % 6 == 0:
-                for (pgid, tmval) in timez:
+                for pgid in re_scrub:
                     # re-request scrub every so often in case the earlier
                     # request was missed.  do not do it every time because
                     # the scrub may be in progress or not reported yet and