]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Give requested scrub work a higher priority 14686/head
authorDavid Zafman <dzafman@redhat.com>
Mon, 17 Apr 2017 21:58:02 +0000 (14:58 -0700)
committerNathan Cutler <ncutler@suse.com>
Thu, 20 Apr 2017 13:45:33 +0000 (15:45 +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 jewel, 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 4eafaf7d42135ab7b080b1645980c4e5eb89f0d2..ce469edcb1125e611db0476d09d15c84f74a50d7 100644 (file)
@@ -871,6 +871,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)
 
 /**
  * osd_recovery_op_warn_multiple scales the normal warning threshhold,
index 84603958d6e6d26aac85e282ff5d313e7d017a67..d5e0d3898e07cdc557ddab032f204500cfc27bcf 100644 (file)
@@ -873,7 +873,7 @@ public:
        PGQueueable(
          PGScrub(pg->get_osdmap()->get_epoch()),
          cct->_conf->osd_scrub_cost,
-         pg->get_scrub_priority(),
+         pg->scrubber.priority,
          ceph_clock_now(cct),
          entity_inst_t())));
   }
index 78da795dbda1a8c161664a6e1e5bc276855ad28f..0684da5c6f72fccf5f894a84ccf945a7196371c0 100644 (file)
@@ -2094,6 +2094,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 5c7f5bf0bede8c91147ace17decd397b9b1971d8..5bb7e56efde6a74d07c2206a0f86e8abe08bbfa9 100644 (file)
@@ -1162,6 +1162,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;