]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Give requested scrub work a higher priority 14735/head
authorDavid Zafman <dzafman@redhat.com>
Mon, 17 Apr 2017 21:58:02 +0000 (14:58 -0700)
committerNathan Cutler <ncutler@suse.com>
Mon, 3 Jul 2017 10:17:05 +0000 (12:17 +0200)
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>
(cherry picked from commit ebab8b1f4f67fbdec1e147c580329c1e2b5cf7cd)

Conflicts:
src/osd/OSD.h - in kraken, the PGScrub() call is enclosed within
                   op_wq.queue(make_pair(...)) instead of enqueue_back()

src/common/config_opts.h
src/osd/OSD.h
src/osd/PG.cc
src/osd/PG.h

index 673da99a8acf0846acd0be9255f11dcb4cd0dfb0..905c1169482f12a1503244b612b315e7717cc817 100644 (file)
@@ -916,6 +916,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 d5c19ff3b4574aaca64e2bedf209082ac03ab617..aecb83b1dd37d2df4e77b77e695f33f8e053bb36 100644 (file)
@@ -897,7 +897,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())));
   }
index 068d337fe58b015e87c1698b4d10ef09d15dbb80..55288807e47c552e878a68fb6d8cbcc4bfa90c17 100644 (file)
@@ -2076,6 +2076,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 f82189cb27844f1b146ac2fe3a2345a8680a15f0..e81551396743cca37fc6c603e0af4d137db96287 100644 (file)
@@ -1101,6 +1101,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;