From: Sage Weil Date: Tue, 31 Jan 2017 20:04:31 +0000 (-0500) Subject: mon/OSDMonitor: prime all pgs if we estimate we're approaching that anyway X-Git-Tag: v12.0.1~343^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b3358ee09bdc96642800d76266bff348aaad680e;p=ceph.git mon/OSDMonitor: prime all pgs if we estimate we're approaching that anyway If we have enough noteworthy OSDs it is likely we will touch all or most PGs anyway, at which point it is faster and simpler to check all pgs. Signed-off-by: Sage Weil --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index aeb58f7b19f1..b903dcf177ff 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -284,6 +284,7 @@ OPTION(mon_osd_allow_primary_temp, OPT_BOOL, false) // allow primary_temp to be OPTION(mon_osd_allow_primary_affinity, OPT_BOOL, false) // allow primary_affinity to be set in the osdmap OPTION(mon_osd_prime_pg_temp, OPT_BOOL, true) // prime osdmap with pg mapping changes OPTION(mon_osd_prime_pg_temp_max_time, OPT_FLOAT, .5) // max time to spend priming +OPTION(mon_osd_prime_pg_temp_max_estimate, OPT_FLOAT, .25) // max estimate of pg total before we do all pgs in parallel OPTION(mon_osd_pool_ec_fast_read, OPT_BOOL, false) // whether turn on fast read on the pool or not OPTION(mon_stat_smooth_intervals, OPT_INT, 6) // smooth stats over last N PGMap maps OPTION(mon_election_timeout, OPT_FLOAT, 5) // on election proposer, max waiting time for all ACKs diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 16d1102ddc7b..ee4b1e877f1d 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1014,6 +1014,23 @@ void OSDMonitor::maybe_prime_pg_temp() if (!all && osds.empty()) return; + if (!all) { + unsigned estimate = + mapping->get_osd_acting_pgs(*osds.begin()).size() * osds.size(); + if (estimate > mapping->get_num_pgs() * + g_conf->mon_osd_prime_pg_temp_max_estimate) { + dout(10) << __func__ << " estimate " << estimate << " pgs on " + << osds.size() << " osds >= " + << g_conf->mon_osd_prime_pg_temp_max_estimate << " of total " + << mapping->get_num_pgs() << " pgs, all" + << dendl; + all = true; + } else { + dout(10) << __func__ << " estimate " << estimate << " pgs on " + << osds.size() << " osds" << dendl; + } + } + OSDMap next; next.deepish_copy_from(osdmap); next.apply_incremental(pending_inc);