]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MgrStatMonitor: trim mgrstat states
authorSage Weil <sage@redhat.com>
Fri, 19 May 2017 15:08:26 +0000 (11:08 -0400)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 17:02:48 +0000 (13:02 -0400)
We don't actually need any of these older states at all so I hard-coded
a constant (oh no!).  In reality it doesn't matter what it is anyway
since PaxosService waits for paxos_service_trim_min (=250) to accumulate
before removing anything.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/MgrStatMonitor.cc
src/mon/MgrStatMonitor.h

index a0e14c2460f9d85c40baee8e3695e033a90fc577..ef61c06346a281fe7f20b49589e4915724780e74 100644 (file)
@@ -118,6 +118,15 @@ void MgrStatMonitor::encode_pending(MonitorDBStore::TransactionRef t)
   put_last_committed(t, version);
 }
 
+version_t MgrStatMonitor::get_trim_to()
+{
+  // we don't actually need *any* old states, but keep a few.
+  if (version > 5) {
+    return version - 5;
+  }
+  return 0;
+}
+
 void MgrStatMonitor::on_active()
 {
 }
index 4a613e8c3873191086653fc1474de4b07ecbb496..e1e02cd4089961013b7a884a9ea2ae8a1b5c4d53 100644 (file)
@@ -35,6 +35,7 @@ public:
   void update_from_paxos(bool *need_bootstrap) override;
   void create_pending() override;
   void encode_pending(MonitorDBStore::TransactionRef t) override;
+  version_t get_trim_to() override;
 
   bool preprocess_query(MonOpRequestRef op) override;
   bool prepare_update(MonOpRequestRef op) override;