From: Sage Weil Date: Fri, 23 Jul 2010 23:19:13 +0000 (-0700) Subject: osd: maintain pg last_update_ondisk X-Git-Tag: v0.21~48^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b033259015ce3461fd3170cad7c13a45eb79434f;p=ceph.git osd: maintain pg last_update_ondisk Only defined when is_active(). Only printed when it lags (i.e. we are in the process of replicating and/or writing an update. --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index bfefe4de39a2..576fada1ed01 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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& 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)! } diff --git a/src/osd/PG.h b/src/osd/PG.h index 88b906ae09db..a385890ba28d 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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; diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 486a022e8c63..da052bcd1e2c 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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); }