]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: indicate last_consumed state after writing "latest" full maps
authorSage Weil <sage@newdream.net>
Thu, 13 Nov 2008 22:19:53 +0000 (14:19 -0800)
committerSage Weil <sage@newdream.net>
Thu, 13 Nov 2008 22:30:35 +0000 (14:30 -0800)
Until then, we may need old incremental states.  This way paxos
won't discard them.

src/mon/ClientMonitor.cc
src/mon/PGMonitor.cc

index 92f6dad238e9555caedc4986db0208c8bc2c3b19..244a75c414d7412b2b4e667596fcb39070fb261c 100644 (file)
@@ -89,6 +89,7 @@ bool ClientMonitor::update_from_paxos()
   bufferlist bl;
   client_map.encode(bl);
   mon->store->put_bl_ss(bl, "clientmap", "latest");
+  mon->store->put_int(paxosv, "clientmap", "last_consumed");
 
   return true;
 }
index 1b2489ee2a9787741748eb4f4d258540b0672865..020b176f892f3e15b621e69eaf52687aa3e6a83a 100644 (file)
@@ -150,11 +150,12 @@ bool PGMonitor::update_from_paxos()
   bufferlist bl;
   pg_map.encode(bl);
   mon->store->put_bl_ss(bl, "pgmap", "latest");
+  mon->store->put_int(paxosv, "pgmap", "last_consumed");
 
   if (mon->is_leader() &&
       mon->is_full_quorum() &&
       paxosv > 10)
-    paxos->trim_to(paxosv-10);
+    paxos->trim_to(paxosv - 10);
 
   if (mon->is_leader())
     send_pg_creates();