Skip to content

Commit

Permalink
mds: note when we last became non-laggy
Browse files Browse the repository at this point in the history
  • Loading branch information
liewegas committed Mar 8, 2010
1 parent 0383878 commit e0c3c15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mds/MDS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,12 @@ void MDS::handle_mds_beacon(MMDSBeacon *m)
beacon_seq_stamp.begin()->first <= seq)
beacon_seq_stamp.erase(beacon_seq_stamp.begin());

utime_t now = g_clock.now();
if (laggy &&
g_clock.now() - beacon_last_acked_stamp < g_conf.mds_beacon_grace) {
now - beacon_last_acked_stamp < g_conf.mds_beacon_grace) {
dout(1) << " clearing laggy flag" << dendl;
laggy = false;
laggy_until = now;
queue_waiters(waiting_for_nolaggy);
}

Expand Down
2 changes: 2 additions & 0 deletions src/mds/MDS.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,10 @@ class MDS : public Dispatcher {
map<version_t,utime_t> beacon_seq_stamp; // seq # -> time sent
utime_t beacon_last_acked_stamp; // last time we sent a beacon that got acked
bool laggy;
utime_t laggy_until;

bool is_laggy() { return laggy; }
utime_t get_laggy_until() { return laggy_until; }

class C_MDS_BeaconSender : public Context {
MDS *mds;
Expand Down

0 comments on commit e0c3c15

Please sign in to comment.