]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add osd_min_recovery_priority tunable
authorSage Weil <sage@inktank.com>
Tue, 17 Jun 2014 20:06:57 +0000 (13:06 -0700)
committerSage Weil <sage@inktank.com>
Tue, 17 Jun 2014 21:35:24 +0000 (14:35 -0700)
Add a tunable to control the minimum priority recovery item that we will
grant a reservation for.  The priority is lower for less-degraded PGs.
This allows a saavy admin to only backfill the least-redundant PGs.

Signed-off-by: Sage Weil <sage@inktank.com>
src/common/config_opts.h
src/osd/OSD.cc

index 741d481c117243cf183e8c5012e95b1acf8d3d19..a078bec5008d962787820e100a603f8363a0fe12 100644 (file)
@@ -394,6 +394,9 @@ OPTION(osd_compact_leveldb_on_mount, OPT_BOOL, false)
 // Maximum number of backfills to or from a single osd
 OPTION(osd_max_backfills, OPT_U64, 10)
 
+// Minimum recovery priority (255 = max, smaller = lower)
+OPTION(osd_min_recovery_priority, OPT_INT, 0)
+
 // Refuse backfills when OSD full ratio is above this value
 OPTION(osd_backfill_full_ratio, OPT_FLOAT, 0.85)
 
index feb7e51a7f2d36d500e7f03ab2cdf4de1d69ef40..c5827772f48116e03803d269d22c84df7630c48e 100644 (file)
@@ -220,8 +220,10 @@ OSDService::OSDService(OSD *osd) :
   last_tid(0),
   tid_lock("OSDService::tid_lock"),
   reserver_finisher(cct),
-  local_reserver(&reserver_finisher, cct->_conf->osd_max_backfills),
-  remote_reserver(&reserver_finisher, cct->_conf->osd_max_backfills),
+  local_reserver(&reserver_finisher, cct->_conf->osd_max_backfills,
+                cct->_conf->osd_min_recovery_priority),
+  remote_reserver(&reserver_finisher, cct->_conf->osd_max_backfills,
+                 cct->_conf->osd_min_recovery_priority),
   pg_temp_lock("OSDService::pg_temp_lock"),
   map_cache_lock("OSDService::map_lock"),
   map_cache(cct->_conf->osd_map_cache_size),
@@ -8233,6 +8235,7 @@ const char** OSD::get_tracked_conf_keys() const
 {
   static const char* KEYS[] = {
     "osd_max_backfills",
+    "osd_min_recovery_priority",
     "osd_op_complaint_time", "osd_op_log_threshold",
     "osd_op_history_size", "osd_op_history_duration",
     "osd_map_cache_size",
@@ -8250,6 +8253,10 @@ void OSD::handle_conf_change(const struct md_config_t *conf,
     service.local_reserver.set_max(cct->_conf->osd_max_backfills);
     service.remote_reserver.set_max(cct->_conf->osd_max_backfills);
   }
+  if (changed.count("osd_min_recovery_priority")) {
+    service.local_reserver.set_min_priority(cct->_conf->osd_min_recovery_priority);
+    service.remote_reserver.set_min_priority(cct->_conf->osd_min_recovery_priority);
+  }
   if (changed.count("osd_op_complaint_time") ||
       changed.count("osd_op_log_threshold")) {
     op_tracker.set_complaint_and_threshold(cct->_conf->osd_op_complaint_time,