]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mdsmap: update last_failure
authorSage Weil <sage@newdream.net>
Mon, 24 Mar 2008 17:54:24 +0000 (10:54 -0700)
committerSage Weil <sage@newdream.net>
Mon, 24 Mar 2008 17:54:24 +0000 (10:54 -0700)
src/mds/MDS.cc
src/mds/MDSMap.h
src/mon/MDSMonitor.cc

index 4e31ab080d3d2c926e5ddf54266715249c3d6923..f6337d3a13ab1c31a4aec8f6c687378c4ba073fe 100644 (file)
@@ -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)
index 6a18667888a10892942a046be57a3756f2b39662..b561da87550b0720aeb0f8ec3f1e5d2187c07b40 100644 (file)
@@ -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; }
 
index 2bacaae77e32d3e554971eba9884bd6710977ce2..2bef87df150ad4b3632e70b27bcaf03227e00e24 100644 (file)
@@ -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;
     }
   }