]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: make number of old paxos states configurable
authorSage Weil <sage@newdream.net>
Fri, 14 Oct 2011 20:30:43 +0000 (13:30 -0700)
committerSage Weil <sage@newdream.net>
Fri, 14 Oct 2011 20:30:52 +0000 (13:30 -0700)
Currently settable on osdmaps, pgmaps, and log.  Still need MDSMap and
authmap trimming.

Signed-off-by: Sage Weil <sage@newdream.net>
src/common/config_opts.h
src/mon/LogMonitor.cc
src/mon/OSDMonitor.cc
src/mon/PGMonitor.cc

index f9b61d3e50f95b6bfafb68a52d7f8505719ae04c..700a6ed8a778258fd9569168cfb26d75fa13cc28 100644 (file)
@@ -95,6 +95,9 @@ OPTION(mon_osd_nearfull_ratio, OPT_INT, 85) // what % full makes an OSD near ful
 OPTION(mon_globalid_prealloc, OPT_INT, 100)   // how many globalids to prealloc
 OPTION(mon_osd_report_timeout, OPT_INT, 900)    // grace period before declaring unresponsive OSDs dead
 OPTION(mon_force_standby_active, OPT_BOOL, true) // should mons force standby-replay mds to be active
+OPTION(mon_min_osdmap_epochs, OPT_INT, 500)
+OPTION(mon_max_pgmap_epochs, OPT_INT, 500)
+OPTION(mon_max_log_epochs, OPT_INT, 500)
 OPTION(paxos_propose_interval, OPT_DOUBLE, 1.0)  // gather updates for this long before proposing a map update
 OPTION(paxos_min_wait, OPT_DOUBLE, 0.05)  // min time to gather updates for after period of inactivity
 OPTION(paxos_observer_timeout, OPT_DOUBLE, 5*60) // gather updates for this long before proposing a map update
index b609a0588495620b080472cc597d6295665bdd91..2c8db1fa882f6e41f9fec48d8507eea8d34f855d 100644 (file)
@@ -171,7 +171,7 @@ bool LogMonitor::update_from_paxos()
 
 
   // trim
-  unsigned max = 500;
+  unsigned max = g_conf->mon_max_log_epochs;
   if (mon->is_leader() && paxosv > max)
     paxos->trim_to(paxosv - max);
 
index 682d57d8982a5e4e72d9db0ea83cab738d8dae90..adc0cd1268da8ded7582a66aefc43829c7911e71 100644 (file)
@@ -1131,7 +1131,7 @@ void OSDMonitor::tick()
       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;
-    unsigned min = 100;
+    unsigned min = g_conf->mon_min_osdmap_epochs;
     if (floor + min < paxos->get_version())
       paxos->trim_to(floor);
   }    
index 08eaabd4e9fe4a9be970919239c4b4b875ff5142..909aa6b348a99a5e490e37c47c89b637a9b55e02 100644 (file)
@@ -180,7 +180,7 @@ bool PGMonitor::update_from_paxos()
     mon->store->put_bl_sn(d, "pgmap_dump", paxosv);
   }
 
-  unsigned max = 500;
+  unsigned max = g_conf->mon_max_pgmap_epochs;
   if (mon->is_leader() &&
       paxosv > max)
     paxos->trim_to(paxosv - max);