From: Sage Weil Date: Tue, 17 Jun 2014 20:06:57 +0000 (-0700) Subject: osd: add osd_min_recovery_priority tunable X-Git-Tag: v0.83~65^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d20da8debe2e1a20e20de501e7b0a0d1a9351281;p=ceph.git osd: add osd_min_recovery_priority tunable 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 --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 741d481c117..a078bec5008 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -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) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index feb7e51a7f2..c5827772f48 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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,