]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: clean open file lists when we go active
authorSage Weil <sage@newdream.net>
Mon, 20 Jul 2009 17:52:41 +0000 (10:52 -0700)
committerSage Weil <sage@newdream.net>
Mon, 20 Jul 2009 18:03:51 +0000 (11:03 -0700)
Not after reconnect, because some caps have a delayed reconnect.
Add a start_active() stub to do this.

src/mds/MDCache.cc
src/mds/MDCache.h
src/mds/MDS.cc
src/mds/MDS.h

index 3e1c51bd2364af914b6e7d3c374b4b1f31edb503..fe962ff3189a6f153c962719f86fcab51a4d8119 100644 (file)
@@ -3910,9 +3910,9 @@ void MDCache::send_snaps(map<int,MClientSnap*>& splits)
  * remove any items from logsegment open_file lists that don't have
  * any caps
  */
-void MDCache::reconnect_clean_open_file_lists()
+void MDCache::clean_open_file_lists()
 {
-  dout(10) << "reconnect_clean_open_file_lists" << dendl;
+  dout(10) << "clean_open_file_lists" << dendl;
   
   for (map<loff_t,LogSegment*>::iterator p = mds->mdlog->segments.begin();
        p != mds->mdlog->segments.end();
index ab2d17da9d9f925753698f3cebc244644a8250e5..42849cdddf818901fe4ca54ebd786e4c9806b101 100644 (file)
@@ -672,8 +672,7 @@ public:
   ESubtreeMap *create_subtree_map();
 
 
-  // [reconnect]
-  void reconnect_clean_open_file_lists();
+  void clean_open_file_lists();
 
 protected:
   // [rejoin]
index 5ddee81adf3dabbb425c016bc60711a911945921..3740737728c5764de82b1e9a97fe90a7882510ab 100644 (file)
@@ -667,7 +667,7 @@ void MDS::handle_mds_map(MMDSMap *m)
       recovery_done();
 
     if (is_active()) {
-      finish_contexts(waiting_for_active);  // kick waiters
+      active_start();
     } else if (is_replay() || is_standby_replay()) {
       replay_start();
     } else if (is_resolve()) {
@@ -997,8 +997,6 @@ void MDS::reconnect_done()
 {
   dout(1) << "reconnect_done" << dendl;
   request_state(MDSMap::STATE_REJOIN);    // move to rejoin state
-
-  mdcache->reconnect_clean_open_file_lists();
 }
 
 void MDS::rejoin_joint_start()
@@ -1030,6 +1028,13 @@ void MDS::clientreplay_done()
   request_state(MDSMap::STATE_ACTIVE);
 }
 
+void MDS::active_start()
+{
+  dout(1) << "active_start" << dendl;
+  mdcache->clean_open_file_lists();
+  finish_contexts(waiting_for_active);  // kick waiters
+}
+
 
 void MDS::recovery_done()
 {
index 91cc7fa2d0185d33d751e99388d65483da9bce02..cce015d41c93f4944f23d8e9dfe858aab2147cf7 100644 (file)
@@ -339,7 +339,7 @@ class MDS : public Dispatcher {
   void handle_mds_recovery(int who);
   void clientreplay_start();
   void clientreplay_done();
-
+  void active_start();
   void stopping_start();
   void stopping_done();
   void suicide();