]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: allow osdmap trimming to be forced via a config option
authorSage Weil <sage@inktank.com>
Mon, 8 Jul 2013 21:55:44 +0000 (14:55 -0700)
committerSage Weil <sage@inktank.com>
Tue, 9 Jul 2013 20:42:34 +0000 (13:42 -0700)
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 <sage@inktank.com>
src/common/config_opts.h
src/mon/OSDMonitor.cc

index fb36058e4ba31a9eb5ad2945a043b78e76679289..07e4e01fefcea379181ae017e655b08e4b07ff50 100644 (file)
@@ -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)
index d6426e4e49323e45436765c0a869e1d7613d2a11..aaacc525fdffedba9e260d64e9abda8290734e07 100644 (file)
@@ -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())