From 985286d773602c86447b1f9fd978ce1b00c03911 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 24 Mar 2008 10:54:24 -0700 Subject: [PATCH] mdsmap: update last_failure --- src/mds/MDS.cc | 2 ++ src/mds/MDSMap.h | 4 +++- src/mon/MDSMonitor.cc | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc index 4e31ab080d3d2..f6337d3a13ab1 100644 --- a/src/mds/MDS.cc +++ b/src/mds/MDS.cc @@ -520,6 +520,8 @@ void MDS::handle_mds_map(MMDSMap *m) assert(mdsmap->get_inc(whoami) > 0); objecter->set_client_incarnation(mdsmap->get_inc(whoami)); } + // and inc_lock + objecter->set_inc_lock(mdsmap->get_last_failure()); // for debug if (g_conf.mds_dump_cache_on_map) diff --git a/src/mds/MDSMap.h b/src/mds/MDSMap.h index 6a18667888a10..b561da87550b0 100644 --- a/src/mds/MDSMap.h +++ b/src/mds/MDSMap.h @@ -123,7 +123,7 @@ class MDSMap { friend class MDSMonitor; public: - MDSMap() : epoch(0), client_epoch(0), anchortable(0), root(0) { + MDSMap() : epoch(0), client_epoch(0), last_failure(0), anchortable(0), root(0) { // hack.. this doesn't really belong here cap_bit_timeout = (int)g_conf.mds_cap_timeout; session_autoclose = (int)g_conf.mds_session_autoclose; @@ -135,6 +135,8 @@ class MDSMap { const utime_t& get_created() const { return created; } void set_created(utime_t ct) { created = ct; } + epoch_t get_last_failure() const { return last_failure; } + int get_max_mds() const { return max_mds; } void set_max_mds(int m) { max_mds = m; } diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 2bacaae77e32d..2bef87df150ad 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -665,6 +665,7 @@ void MDSMonitor::tick() case MDSMap::STATE_ACTIVE: case MDSMap::STATE_STOPPING: newstate = MDSMap::STATE_FAILED; + pending_mdsmap.last_failure = pending_mdsmap.epoch; break; default: @@ -732,6 +733,7 @@ void MDSMonitor::do_stop() case MDSMap::STATE_REJOIN: // BUG: hrm, if this is the case, the STOPPING gusy won't be able to stop, will they? pending_mdsmap.mds_state[p->first] = MDSMap::STATE_FAILED; + pending_mdsmap.last_failure = pending_mdsmap.epoch; break; } } -- 2.39.5