]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: maintain pg last_update_ondisk
authorSage Weil <sage@newdream.net>
Fri, 23 Jul 2010 23:19:13 +0000 (16:19 -0700)
committerSage Weil <sage@newdream.net>
Sat, 24 Jul 2010 16:37:42 +0000 (09:37 -0700)
Only defined when is_active().  Only printed when it lags (i.e. we are
in the process of replicating and/or writing an update.

src/osd/PG.cc
src/osd/PG.h
src/osd/ReplicatedPG.cc

index bfefe4de39a2f2edcfa944210ba6c10bdd8f5255..576fada1ed01bc4838dcc48368bd4cce8d89aa18 100644 (file)
@@ -1034,6 +1034,8 @@ void PG::clear_primary_state()
   min_last_complete_ondisk = eversion_t();
   stray_purged.clear();
 
+  last_update_ondisk = eversion_t();
+
   snap_trimq.clear();
 
   finish_sync_event = 0;  // so that _finish_recvoery doesn't go off in another thread
@@ -1587,6 +1589,7 @@ void PG::activate(ObjectStore::Transaction& t, list<Context*>& tfin,
   trim_past_intervals();
   
   if (role == 0) {    // primary state
+    last_update_ondisk = info.last_update;
     min_last_complete_ondisk = eversion_t(0,0);  // we don't know (yet)!
   }
 
index 88b906ae09db601bbded22ca59c55e0fce0610d3..a385890ba28d3a95e09041e30e77fa2754764279 100644 (file)
@@ -739,6 +739,7 @@ protected:
   int         state;   // see bit defns above
 
 public:
+  eversion_t  last_update_ondisk;    // last_update that has committed; ONLY DEFINED WHEN is_active()
   eversion_t  last_complete_ondisk;  // last_complete that has committed.
 
   // primary state
@@ -1087,6 +1088,10 @@ inline ostream& operator<<(ostream& out, const PG& pg)
     out << "/" << pg.acting;
   out << " r=" << pg.get_role();
   
+  if (pg.is_active() &&
+      pg.last_update_ondisk != pg.info.last_update)
+    out << " luod=" << pg.last_update_ondisk;
+
   if (pg.recovery_ops_active)
     out << " rops=" << pg.recovery_ops_active;
 
index 486a022e8c63330196954d4c9f611614e047ab53..da052bcd1e2c08f5bc95fc1e7f0305a653e63727 100644 (file)
@@ -2179,6 +2179,7 @@ void ReplicatedPG::op_commit(RepGather *repop)
     dout(10) << "op_commit " << *repop << dendl;
     repop->waitfor_disk.erase(osd->get_nodeid());
     //repop->waitfor_nvram.erase(osd->get_nodeid());
+    last_update_ondisk = repop->v;
     last_complete_ondisk = repop->pg_local_last_complete;
     eval_repop(repop);
   }