From: Sage Weil Date: Mon, 8 Jul 2013 21:55:44 +0000 (-0700) Subject: mon/OSDMonitor: allow osdmap trimming to be forced via a config option X-Git-Tag: v0.67-rc1~131^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=449283f802206694734dfe9d6e110cb717d1fffe;p=ceph.git mon/OSDMonitor: allow osdmap trimming to be forced via a config option In certain cases the admin may know that it is safe to trim old osdmaps but a bug or other issue is preventing the Monitor from deciding on its own. Signed-off-by: Sage Weil --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index fb36058e4ba..07e4e01fefc 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -184,6 +184,7 @@ OPTION(mon_sync_debug_provider, OPT_INT, -1) // monitor to be used as the sync p OPTION(mon_sync_debug_provider_fallback, OPT_INT, -1) // monitor to be used as fallback if sync provider fails OPTION(mon_osd_min_down_reporters, OPT_INT, 1) // number of OSDs who need to report a down OSD for it to count OPTION(mon_osd_min_down_reports, OPT_INT, 3) // number of times a down OSD must be reported for it to count +OPTION(mon_osd_force_trim_to, OPT_INT, 0) // force mon to trim maps to this point, regardless of min_last_epoch_clean (dangerous, use with care) // dump transactions OPTION(mon_debug_dump_transactions, OPT_BOOL, false) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index d6426e4e493..aaacc525fdf 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -539,6 +539,11 @@ void OSDMonitor::update_trim() mon->pgmon()->pg_map.creating_pgs.empty()) { epoch_t floor = mon->pgmon()->pg_map.calc_min_last_epoch_clean(); dout(10) << " min_last_epoch_clean " << floor << dendl; + if (g_conf->mon_osd_force_trim_to > 0 && + g_conf->mon_osd_force_trim_to < (int)get_last_committed()) { + floor = g_conf->mon_osd_force_trim_to; + dout(10) << " explicit mon_osd_force_trim_to = " << floor << dendl; + } unsigned min = g_conf->mon_min_osdmap_epochs; if (floor + min > get_last_committed()) { if (min < get_last_committed())