]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: trim old logm states
authorSage Weil <sage@newdream.net>
Thu, 29 Jul 2010 16:16:57 +0000 (09:16 -0700)
committerSage Weil <sage@newdream.net>
Thu, 29 Jul 2010 16:17:03 +0000 (09:17 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/LogMonitor.cc

index be2982b1ebccd88354ce001b76198b092e1b7f66..eeef24b100fccdeb97c5fe2ba4eb78628eb22ff9 100644 (file)
@@ -168,6 +168,12 @@ bool LogMonitor::update_from_paxos()
   if (blogerr.length())
     mon->store->append_bl_ss(blogerr, "log.err", NULL);
 
+
+  // trim
+  int max = 500;
+  if (mon->is_leader() && paxosv > max)
+    paxos->trim_to(paxosv - max);
+
   return true;
 }