]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: adjust mds state asserts to include clientreplay
authorSage Weil <sage@newdream.net>
Tue, 4 Aug 2009 00:19:49 +0000 (17:19 -0700)
committerSage Weil <sage@newdream.net>
Tue, 4 Aug 2009 22:33:35 +0000 (15:33 -0700)
src/mds/Locker.cc
src/mds/MDCache.cc
src/mds/MDS.cc
src/mds/MDSMap.h
src/mds/Migrator.cc

index 6b15c73e9d6cc7a3da2a3100684df20a9f8a3351..fb0009660686ca95a14c317cba2d4528f98b6d2c 100644 (file)
@@ -1369,7 +1369,7 @@ void Locker::request_inode_file_caps(CInode *in)
 void Locker::handle_inode_file_caps(MInodeFileCaps *m)
 {
   // nobody should be talking to us during recovery.
-  assert(mds->is_rejoin() || mds->is_active() || mds->is_stopping());
+  assert(mds->is_rejoin() || mds->is_clientreplay() || mds->is_active() || mds->is_stopping());
 
   // ok
   CInode *in = mdcache->get_inode(m->get_ino());
@@ -1611,7 +1611,7 @@ void Locker::handle_client_caps(MClientCaps *m)
          << " follows " << follows 
          << " op " << ceph_cap_op_name(m->get_op()) << dendl;
 
-  if (!mds->is_active() && !mds->is_stopping() && !mds->is_clientreplay()) {
+  if (!mds->is_clientreplay() && !mds->is_active() && !mds->is_stopping()) {
     mds->wait_for_replay(new C_MDS_RetryMessage(mds, m));
     return;
   }
@@ -2262,7 +2262,7 @@ SimpleLock *Locker::get_lock(int lock_type, MDSCacheObjectInfo &info)
 void Locker::handle_lock(MLock *m)
 {
   // nobody should be talking to us during recovery.
-  assert(mds->is_rejoin() || mds->is_active() || mds->is_stopping());
+  assert(mds->is_rejoin() || mds->is_clientreplay() || mds->is_active() || mds->is_stopping());
 
   SimpleLock *lock = get_lock(m->get_lock_type(), m->get_object_info());
   if (!lock) {
index 79a7d0c7043ec78328c4d72cb011932017c99084..b34764babae30a2a2d9d319ec261dba3cd39a4ad 100644 (file)
@@ -794,7 +794,7 @@ void MDCache::try_subtree_merge_at(CDir *dir)
     //   hit the disk before the relevant dirfrags ever close)
     if (dir->inode->is_auth() &&
        dir->inode->can_auth_pin() &&
-       (mds->is_active() || mds->is_stopping())) {
+       (mds->is_clientreplay() || mds->is_active() || mds->is_stopping())) {
       CInode *in = dir->inode;
       dout(10) << "try_subtree_merge_at journaling merged bound " << *in << dendl;
       
@@ -2286,7 +2286,7 @@ void MDCache::handle_resolve(MMDSResolve *m)
   }
 
   // am i a surviving ambiguous importer?
-  if (mds->is_active() || mds->is_stopping()) {
+  if (mds->is_clientreplay() || mds->is_active() || mds->is_stopping()) {
     // check for any import success/failure (from this node)
     map<dirfrag_t, vector<dirfrag_t> >::iterator p = my_ambiguous_imports.begin();
     while (p != my_ambiguous_imports.end()) {
@@ -3017,7 +3017,7 @@ void MDCache::handle_cache_rejoin_weak(MMDSCacheRejoin *weak)
   MMDSCacheRejoin *ack = 0;      // if survivor
   bool survivor = false;  // am i a survivor?
   
-  if (mds->is_active() || mds->is_stopping()) {
+  if (mds->is_clientreplay() || mds->is_active() || mds->is_stopping()) {
     survivor = true;
     dout(10) << "i am a surivivor, and will ack immediately" << dendl;
     ack = new MMDSCacheRejoin(MMDSCacheRejoin::OP_ACK);
index 62ab6e4988467531add296c210cc873888d7bc55..6c10ed85e0ad703f3d59d8b7d603b76b9199f5ff 100644 (file)
@@ -692,7 +692,7 @@ void MDS::handle_mds_map(MMDSMap *m)
   
   // RESOLVE
   // is someone else newly resolving?
-  if (is_resolve() || is_rejoin() || is_active() || is_stopping()) {
+  if (is_resolve() || is_rejoin() || is_clientreplay() || is_active() || is_stopping()) {
     set<int> oldresolve, resolve;
     oldmap->get_mds_set(oldresolve, MDSMap::STATE_RESOLVE);
     mdsmap->get_mds_set(resolve, MDSMap::STATE_RESOLVE);
@@ -707,7 +707,7 @@ void MDS::handle_mds_map(MMDSMap *m)
   
   // REJOIN
   // is everybody finally rejoining?
-  if (is_rejoin() || is_active() || is_stopping()) {
+  if (is_rejoin() || is_clientreplay() || is_active() || is_stopping()) {
     // did we start?
     if (!oldmap->is_rejoining() && mdsmap->is_rejoining())
       rejoin_joint_start();
@@ -721,7 +721,7 @@ void MDS::handle_mds_map(MMDSMap *m)
     dout(1) << "cluster recovered." << dendl;
   
   // did someone go active?
-  if (is_active() || is_stopping()) {
+  if (is_clientreplay() || is_active() || is_stopping()) {
     set<int> oldactive, active;
     oldmap->get_mds_set(oldactive, MDSMap::STATE_ACTIVE);
     mdsmap->get_mds_set(active, MDSMap::STATE_ACTIVE);
@@ -750,7 +750,7 @@ void MDS::handle_mds_map(MMDSMap *m)
          oldmap->get_inst(*p) != mdsmap->get_inst(*p))
        mdcache->handle_mds_failure(*p);
   }
-  if (is_active() || is_stopping()) {
+  if (is_clientreplay() || is_active() || is_stopping()) {
     // did anyone stop?
     set<int> oldstopped, stopped;
     oldmap->get_stopped_mds_set(oldstopped);
@@ -1046,7 +1046,7 @@ void MDS::active_start()
 void MDS::recovery_done()
 {
   dout(1) << "recovery_done -- successful recovery!" << dendl;
-  assert(is_active() || is_clientreplay());
+  assert(is_clientreplay() || is_active() || is_clientreplay());
   
   // kick anchortable (resent AGREEs)
   if (mdsmap->get_tableserver() == whoami) {
index 22e46e64800e0d3769fd7571b8ac3381cdb72207..1400f49440f4927f649c3dd2856dea23e062356c 100644 (file)
@@ -312,7 +312,7 @@ public:
   bool is_clientreplay(int m)   { return get_state(m) == STATE_CLIENTREPLAY; }
   bool is_active(int m)   { return get_state(m) == STATE_ACTIVE; }
   bool is_stopping(int m) { return get_state(m) == STATE_STOPPING; }
-  bool is_active_or_stopping(int m)   { return is_active(m) || is_stopping(m); }
+  bool is_clientreplay_or_active_or_stopping(int m)   { return is_clientreplay(m) || is_active(m) || is_stopping(m); }
 
   bool is_laggy(entity_addr_t a) { return mds_info.count(a) && mds_info[a].laggy(); }
 
index 0aa1a11c854e87fba996f9ffbc1ecd3aa0827fcc..2061079ce9d40bc670e9adf1f9a243d14064b389 100644 (file)
@@ -762,7 +762,7 @@ void Migrator::handle_export_prep_ack(MExportDirPrepAck *m)
        p != dir->replicas_end();
        ++p) {
     if (p->first == dest) continue;
-    if (!mds->mdsmap->is_active_or_stopping(p->first))
+    if (!mds->mdsmap->is_clientreplay_or_active_or_stopping(p->first))
       continue;  // only if active
     export_warning_ack_waiting[dir].insert(p->first);
     export_notify_ack_waiting[dir].insert(p->first);  // we'll eventually get a notifyack, too!
@@ -1228,7 +1228,7 @@ void Migrator::export_logged_finish(CDir *dir)
        p != export_notify_ack_waiting[dir].end();
        ++p) {
     MExportDirNotify *notify;
-    if (mds->mdsmap->is_active_or_stopping(export_peer[dir])) 
+    if (mds->mdsmap->is_clientreplay_or_active_or_stopping(export_peer[dir])) 
       // dest is still alive.
       notify = new MExportDirNotify(dir->dirfrag(), true,
                                    pair<int,int>(mds->get_nodeid(), dest),
@@ -1316,7 +1316,7 @@ void Migrator::export_finish(CDir *dir)
   }
 
   // send finish/commit to new auth
-  if (mds->mdsmap->is_active_or_stopping(export_peer[dir])) {
+  if (mds->mdsmap->is_clientreplay_or_active_or_stopping(export_peer[dir])) {
     mds->send_message_mds(new MExportDirFinish(dir->dirfrag()), export_peer[dir]);
   } else {
     dout(7) << "not sending MExportDirFinish, dest has failed" << dendl;