summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGreg Farnum <gregf@hq.newdream.net>2009-10-09 01:28:39 +0200
committerGreg Farnum <gregf@hq.newdream.net>2009-10-10 01:44:51 +0200
commited70b5ae1faba8271098ea4287b09f70be39cd00 (patch)
tree4aff77b921473f276f4c9cb6c3362fe4ea405e81 /src
parentmon: Add MonmapMonitor to whole system (diff)
downloadceph-ed70b5ae1faba8271098ea4287b09f70be39cd00.tar.xz
ceph-ed70b5ae1faba8271098ea4287b09f70be39cd00.zip
mdsmap: add a last_changed utime_t data member.
Diffstat (limited to 'src')
-rw-r--r--src/mon/MonMap.h4
-rw-r--r--src/mon/MonmapMonitor.cc2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/mon/MonMap.h b/src/mon/MonMap.h
index 9313d9f0ec3..24f4ef0f17b 100644
--- a/src/mon/MonMap.h
+++ b/src/mon/MonMap.h
@@ -26,11 +26,13 @@ class MonMap {
epoch_t epoch; // what epoch/version of the monmap
ceph_fsid_t fsid;
vector<entity_inst_t> mon_inst;
+ utime_t last_changed;
int last_mon; // last mon i talked to
MonMap() : epoch(0), last_mon(-1) {
memset(&fsid, 0, sizeof(fsid));
+ last_changed = g_clock.now();
}
ceph_fsid_t& get_fsid() { return fsid; }
@@ -89,6 +91,7 @@ class MonMap {
::encode_raw(fsid, blist);
::encode(epoch, blist);
::encode(mon_inst, blist);
+ ::encode(last_changed, blist);
}
void decode(bufferlist& blist) {
bufferlist::iterator p = blist.begin();
@@ -100,6 +103,7 @@ class MonMap {
::decode_raw(fsid, p);
::decode(epoch, p);
::decode(mon_inst, p);
+ ::decode(last_changed, p);
}
diff --git a/src/mon/MonmapMonitor.cc b/src/mon/MonmapMonitor.cc
index a231ce08077..0c7d0caca96 100644
--- a/src/mon/MonmapMonitor.cc
+++ b/src/mon/MonmapMonitor.cc
@@ -64,6 +64,7 @@ void MonmapMonitor::create_pending()
{
pending_map = *mon->monmap;
pending_map.epoch++;
+ pending_map.last_changed = g_clock.now();
dout(10) << "create_pending monmap epoch " << pending_map.epoch << dendl;
}
@@ -84,6 +85,7 @@ bool MonmapMonitor::prepare_update(PaxosServiceMessage *message)
{
MMonAdd *m = (MMonAdd *) message;
pending_map.add(m->address);
+ pending_map.last_changed = g_clock.now();
return true;
}