]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Give requested scrub work a higher priority 14488/head
authorDavid Zafman <dzafman@redhat.com>
Mon, 17 Apr 2017 21:58:02 +0000 (14:58 -0700)
committerDavid Zafman <dzafman@redhat.com>
Mon, 17 Apr 2017 21:58:02 +0000 (14:58 -0700)
Once started we now queue scrub work at higher priority than
scheduled scrubs.

Fixes: http://tracker.ceph.com/issues/15789
Signed-off-by: David Zafman <dzafman@redhat.com>
src/common/config_opts.h
src/osd/OSD.h
src/osd/PG.cc
src/osd/PG.h

index 8984c35594e328804ded47bb4227a4200bbfa73e..4ff85b091a3a13b6699abd0fbbef0c1601c1e09d 100644 (file)
@@ -942,6 +942,9 @@ OPTION(osd_snap_trim_cost, OPT_U32, 1<<20) // set default cost equal to 1MB io
 OPTION(osd_scrub_priority, OPT_U32, 5)
 // set default cost equal to 50MB io
 OPTION(osd_scrub_cost, OPT_U32, 50<<20) 
+// set requested scrub priority higher than scrub priority to make the
+// requested scrubs jump the queue of scheduled scrubs
+OPTION(osd_requested_scrub_priority, OPT_U32, 120)
 
 OPTION(osd_recovery_priority, OPT_U32, 5)
 // set default cost equal to 20MB io
index 73998a100e59eb583d6da0b916240284b345b8ff..8aa4e6a2202688cac2ea52b7c29fce7cb3284ffe 100644 (file)
@@ -961,7 +961,7 @@ public:
       PGQueueable(
        PGScrub(pg->get_osdmap()->get_epoch()),
        cct->_conf->osd_scrub_cost,
-       pg->get_scrub_priority(),
+       pg->scrubber.priority,
        ceph_clock_now(),
        entity_inst_t(),
        pg->get_osdmap()->get_epoch()));
index 56b9c19bed8ddd23b1105d0ba941196f85936951..1feb4286155fccb3dd563da5899a0b28072a89f3 100644 (file)
@@ -2009,6 +2009,8 @@ bool PG::queue_scrub()
   if (is_scrubbing()) {
     return false;
   }
+  scrubber.priority = scrubber.must_scrub ?
+         cct->_conf->osd_requested_scrub_priority : get_scrub_priority();
   scrubber.must_scrub = false;
   state_set(PG_STATE_SCRUBBING);
   if (scrubber.must_deep_scrub) {
index 4763859d66b9adb3868fef21966fa16761b9dcd8..e5530a11ff7c7af61a2d53e14c080d3546151264 100644 (file)
@@ -1159,6 +1159,9 @@ public:
     // flags to indicate explicitly requested scrubs (by admin)
     bool must_scrub, must_deep_scrub, must_repair;
 
+    // Priority to use for scrub scheduling
+    unsigned priority;
+
     // this flag indicates whether we would like to do auto-repair of the PG or not
     bool auto_repair;