Skip to contentSkip to conversation

mds: Don't drop client request from MDS

PATCH In review Yan, Zheng 2 participants 16 messages Oct 2, 2012 – Oct 3, 2012

lore
Share & tools
lore

Yan, Zheng

author
#0 lore raw

PATCH 1/12 mds: Don't drop client request from MDS

From: "Yan, Zheng" <[email protected]>

MDS may send client request for stray migration/reintegration.

---
 src/mds/MDCache.cc | 3 ++-
 src/mds/MDS.cc     | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
src/mds/MDCache.cc +2 -1
index 06933f9..efa6671 100644
@@ -7473,7 +7473,8 @@ void MDCache::request_forward(MDRequest *mdr, int who, int port)
 void MDCache::dispatch_request(MDRequest *mdr)
 {
   if (mdr->client_request) {
-    if (!mdr->item_session_request.is_on_list()) {
+    if (!mdr->reqid.name.is_mds() &&
+	!mdr->item_session_request.is_on_list()) {
       dout(10) << "request " << *mdr << " is canceled" << dendl;
       return;
     }
src/mds/MDS.cc +1 -1
index 8a5355b..3e7c97c 100644
@@ -1716,9 +1716,9 @@ bool MDS::handle_deferrable_message(Message *m)
     switch (m->get_type()) {
       // SERVER
     case CEPH_MSG_CLIENT_SESSION:
-    case CEPH_MSG_CLIENT_REQUEST:
     case CEPH_MSG_CLIENT_RECONNECT:
       ALLOW_MESSAGES_FROM(CEPH_ENTITY_TYPE_CLIENT);
+    case CEPH_MSG_CLIENT_REQUEST:
       server->dispatch(m);
       break;
     case MSG_MDS_SLAVE_REQUEST:
Signature · 1 line
1.7.11.4
author
#1 lore raw

PATCH 2/12 mds: Consider stopping MDS when finding peer inode

From: "Yan, Zheng" <[email protected]>

To migrate strays, the receiving MDS need find stopping MDS' mdsdir

---
 src/mds/MDCache.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
src/mds/MDCache.cc +2 -1
index efa6671..1a93d9b 100644
@@ -7225,8 +7225,9 @@ void MDCache::find_ino_peers(inodeno_t ino, Context *c, int hint)
 void MDCache::_do_find_ino_peer(find_ino_peer_info_t& fip)
 {
   set<int> all, active;
-  mds->mdsmap->get_active_mds_set(active);
   mds->mdsmap->get_mds_set(all);
+  mds->mdsmap->get_active_mds_set(active);
+  mds->mdsmap->get_mds_set(active, MDSMap::STATE_STOPPING);
 
   dout(10) << "_do_find_ino_peer " << fip.tid << " " << fip.ino
 	   << " active " << active << " all " << all
Signature · 1 line
1.7.11.4
author
#2 lore raw

PATCH 3/12 mds: Add finish callback to waiting_for_base_ino wait queue

In reply to Yan, Zheng

From: "Yan, Zheng" <[email protected]>

---
 src/mds/MDCache.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/mds/MDCache.cc +1 -1
index 1a93d9b..1348b3e 100644
@@ -8341,8 +8341,8 @@ void MDCache::discover_base_ino(inodeno_t want_ino,
     discover_info_t& d = _create_discover(from);
     d.ino = want_ino;
     _send_discover(d);
-    waiting_for_base_ino[from][want_ino].push_back(onfinish);
   }
+  waiting_for_base_ino[from][want_ino].push_back(onfinish);
 }
 
 
Signature · 1 line
1.7.11.4
author
#3 lore raw

PATCH 4/12 mds: Allow rename request for stray migration/reintegration

In reply to Yan, Zheng

From: "Yan, Zheng" <[email protected]>

Allow rename request to modify system directory if it is for stray migration/reintegration.

---
 src/mds/Server.cc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
src/mds/Server.cc +6 -4
index 4c52ca2..8584e60 100644
@@ -1983,7 +1983,7 @@ CDentry* Server::rdlock_path_xlock_dentry(MDRequest *mdr, int n,
   }
 
   CInode *diri = dir->get_inode();
-  if (diri->is_system() && !diri->is_root()) {
+  if (!mdr->reqid.name.is_mds() && diri->is_system() && !diri->is_root()) {
     reply_request(mdr, -EROFS);
     return 0;
   }
@@ -5126,10 +5126,12 @@ void Server::handle_client_rename(MDRequest *mdr)
     pdn = pdn->get_dir()->inode->parent;
   }
 
-  // is this a stray reintegration or merge? (sanity checks!)
+  // is this a stray migration, reintegration or merge? (sanity checks!)
   if (mdr->reqid.name.is_mds() &&
-      (!destdnl->is_remote() ||
-       destdnl->get_remote_ino() != srci->ino())) {
+      !(MDS_INO_IS_STRAY(srcpath.get_ino()) &&
+	MDS_INO_IS_STRAY(destpath.get_ino())) &&
+      !(destdnl->is_remote() &&
+	destdnl->get_remote_ino() == srci->ino())) {
     reply_request(mdr, -EINVAL);  // actually, this won't reply, but whatev.
     return;
   }
Signature · 1 line
1.7.11.4
author
#4 lore raw

PATCH 5/12 mds: Fix xlock imports

In reply to Yan, Zheng

From: "Yan, Zheng" <[email protected]>

Xlock imports and capability imports are uncorrelated, we should call xlock_import() even there is no capability import.

---
 src/mds/Server.cc | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
src/mds/Server.cc +9 -9
index 8584e60..7659b23 100644
@@ -5838,16 +5838,16 @@ void Server::_rename_apply(MDRequest *mdr, CDentry *srcdn, CDentry *destdn, CDen
       if (mdr->more()->cap_imports.count(destdnl->get_inode())) {
 	mds->mdcache->migrator->finish_import_inode_caps(destdnl->get_inode(), srcdn->authority().first, 
 							 mdr->more()->cap_imports[destdnl->get_inode()]);
-	/* hack: add an auth pin for each xlock we hold. These were
-	 * remote xlocks previously but now they're local and
-	 * we're going to try and unpin when we xlock_finish. */
-	for (set<SimpleLock *>::iterator i = mdr->xlocks.begin();
-	    i !=  mdr->xlocks.end();
-	    ++i)
-	  if ((*i)->get_parent() == destdnl->get_inode() &&
-	      !(*i)->is_locallock())
-	    mds->locker->xlock_import(*i, mdr);
       }
+      /* hack: add an auth pin for each xlock we hold. These were
+       * remote xlocks previously but now they're local and
+       * we're going to try and unpin when we xlock_finish. */
+      for (set<SimpleLock *>::iterator i = mdr->xlocks.begin();
+	  i !=  mdr->xlocks.end();
+	  ++i)
+	if ((*i)->get_parent() == destdnl->get_inode() &&
+	    !(*i)->is_locallock())
+	  mds->locker->xlock_import(*i, mdr);
       
       // hack: fix auth bit
       in->state_set(CInode::STATE_AUTH);
Signature · 1 line
1.7.11.4
author
#5 lore raw

PATCH 6/12 mds: Set metablob.renamed_dirino in do_rename_rollback()

In reply to Yan, Zheng

From: "Yan, Zheng" <[email protected]>

---
 src/mds/Server.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
src/mds/Server.cc +4 -1
index 7659b23..e16800e 100644
@@ -6395,8 +6395,11 @@ void Server::do_rename_rollback(bufferlist &rbl, int master, MDRequest *mdr)
     le->commit.add_null_dentry(straydn, true);
   }
 
-  if (in->is_dir())
+  if (in->is_dir()) {
+    dout(10) << " noting renamed dir ino " << in->ino() << " in metablob" << dendl;
+    le->commit.renamed_dirino = in->ino();
     mdcache->project_subtree_rename(in, destdir, srcdir);
+  }
   
   mdlog->submit_entry(le, new C_MDS_LoggedRenameRollback(this, mut, mdr,
 							 srcdnl->get_inode(), destdir));
Signature · 1 line
1.7.11.4
author
#6 lore raw

PATCH 7/12 mds: Avoid save unnecessary parent snaprealm

In reply to Yan, Zheng

From: "Yan, Zheng" <[email protected]>

We can avoid save parent snaprealm if current_parent_since is greater than parent snaprealm's newest sequence.

---
 src/mds/CInode.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
src/mds/CInode.cc +4 -2
index 8fed424..8566e55 100644
@@ -386,8 +386,10 @@ void CInode::project_past_snaprealm_parent(SnapRealm *newparent)
 
   if (newparent != oldparent) {
     snapid_t oldparentseq = oldparent->get_newest_seq();
-    new_snap->past_parents[oldparentseq].ino = oldparent->inode->ino();
-    new_snap->past_parents[oldparentseq].first = new_snap->current_parent_since;
+    if (oldparentseq + 1 > new_snap->current_parent_since) {
+      new_snap->past_parents[oldparentseq].ino = oldparent->inode->ino();
+      new_snap->past_parents[oldparentseq].first = new_snap->current_parent_since;
+    }
     new_snap->current_parent_since = MAX(oldparentseq, newparent->get_last_created()) + 1;
   }
 }
Signature · 1 line
1.7.11.4
author
#7 lore raw

PATCH 8/12 mds: Allow export subtrees in other MDS' stray directory

In reply to Yan, Zheng

From: "Yan, Zheng" <[email protected]>

Stray migration is implemented by rename, it may create auth subtrees in other MDS' stray directory.

---
 src/mds/Migrator.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
src/mds/Migrator.cc +2 -1
index 5f727a9..98ab4e1 100644
@@ -640,7 +640,8 @@ void Migrator::export_dir(CDir *dir, int dest)
     return;
   }
 
-  if (!dir->inode->is_base() && dir->inode->get_parent_dir()->get_inode()->is_stray()) {
+  if (!dir->inode->is_base() &&
+      dir->inode->get_parent_dir()->ino() == MDS_INO_MDSDIR(mds->get_nodeid())) {
     dout(7) << "i won't export anything in stray" << dendl;
     return;
   }
Signature · 1 line
1.7.11.4
author
#8 lore raw

PATCH 9/12 mds: Properly update dirty dir fragstat during log replay

In reply to Yan, Zheng

From: "Yan, Zheng" <[email protected]>

Dirty dir fragstat is managed by filelock instead of nestlock.

---
 src/mds/journal.cc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
src/mds/journal.cc +8 -2
index 38f8c0e..0de3f39 100644
@@ -488,14 +488,20 @@ void EMetaBlob::replay(MDS *mds, LogSegment *logseg)
       dir->get_inode()->filelock.mark_dirty();
       dir->get_inode()->nestlock.mark_dirty();
 
-      if (!(dir->fnode.rstat == dir->fnode.accounted_rstat) ||
-	  !(dir->fnode.fragstat == dir->fnode.accounted_fragstat)) {
+      if (!(dir->fnode.rstat == dir->fnode.accounted_rstat)) {
 	dout(10) << "EMetaBlob.replay      dirty nestinfo on " << *dir << dendl;
 	mds->locker->mark_updated_scatterlock(&dir->inode->nestlock);
 	logseg->dirty_dirfrag_nest.push_back(&dir->inode->item_dirty_dirfrag_nest);
       } else {
 	dout(10) << "EMetaBlob.replay      clean nestinfo on " << *dir << dendl;
       }
+      if (!(dir->fnode.fragstat == dir->fnode.accounted_fragstat)) {
+	dout(10) << "EMetaBlob.replay      dirty fragstat on " << *dir << dendl;
+	mds->locker->mark_updated_scatterlock(&dir->inode->filelock);
+	logseg->dirty_dirfrag_dir.push_back(&dir->inode->item_dirty_dirfrag_dir);
+      } else {
+	dout(10) << "EMetaBlob.replay      clean fragstat on " << *dir << dendl;
+      }
     }
     if (lump.is_new())
       dir->mark_new(logseg);
Signature · 1 line
1.7.11.4
author
#9 lore raw

PATCH 10/12 mds: Trim non auth subtree directory

In reply to Yan, Zheng

From: "Yan, Zheng" <[email protected]>

Trim non auth subtree directory if all its dentries were trimmed and it's not bound of auth subtree.

---
 src/mds/MDCache.cc | 9 +++++++++
 1 file changed, 9 insertions(+)
src/mds/MDCache.cc +9 -0
index 1348b3e..397b991 100644
@@ -5412,6 +5412,15 @@ bool MDCache::trim(int max)
       ++i)
     lru.lru_insert_mid(*i);
 
+  for (map<CDir*, set<CDir*> >::iterator p = subtrees.begin();
+       p != subtrees.end();) {
+    CDir *dir = p->first;
+    p++;
+    if (!dir->is_auth() && !dir->get_inode()->is_auth()) {
+      if (dir->get_num_ref() == 1)  // subtree pin
+	trim_dirfrag(dir, 0, expiremap);
+    }
+  }
   // trim root?
   if (max == 0 && root) {
     list<CDir*> ls;
Signature · 1 line
1.7.11.4
author
#10 lore raw

PATCH 11/12 mds: Properly re-calculate mdsdir inode's auth bit

In reply to Yan, Zheng

From: "Yan, Zheng" <[email protected]>

---
 src/mds/MDCache.cc | 5 +++++
 1 file changed, 5 insertions(+)
src/mds/MDCache.cc +5 -0
index 397b991..8b02b8b 100644
@@ -3132,6 +3132,11 @@ void MDCache::recalc_auth_bits()
   for (map<CDir*,set<CDir*> >::iterator p = subtrees.begin();
        p != subtrees.end();
        ++p) {
+
+    CInode *inode = p->first->get_inode();
+    if (inode->is_mdsdir() && inode->ino() != MDS_INO_MDSDIR(mds->get_nodeid()))
+      inode->state_clear(CInode::STATE_AUTH);
+
     list<CDir*> dfq;  // dirfrag queue
     dfq.push_back(p->first);
 
Signature · 1 line
1.7.11.4
author
#11 lore raw

PATCH 12/12 mds: Avoid creating unnecessary snaprealm

In reply to Yan, Zheng

From: "Yan, Zheng" <[email protected]>

When moving directory between snaprealms, we can avoid creating snaprealm if the directory doesn't has its own snaprealm and directory was created after both realms' newest snapshot.

---
 src/mds/Server.cc | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)
src/mds/Server.cc +17 -8
index e16800e..b706b5a 100644
@@ -4577,7 +4577,8 @@ void Server::_unlink_local(MDRequest *mdr, CDentry *dn, CDentry *straydn)
     mdcache->predirty_journal_parents(mdr, &le->metablob, in, straydn->get_dir(), PREDIRTY_PRIMARY|PREDIRTY_DIR, 1);
 
     // project snaprealm, too
-    in->project_past_snaprealm_parent(straydn->get_dir()->inode->find_snaprealm());
+    if (in->snaprealm || follows + 1 > dn->first)
+      in->project_past_snaprealm_parent(straydn->get_dir()->inode->find_snaprealm());
 
     le->metablob.add_primary_dentry(straydn, true, in);
   } else {
@@ -5247,11 +5248,16 @@ void Server::handle_client_rename(MDRequest *mdr)
   }
 
   // moving between snaprealms?
-  if (srcdnl->is_primary() && !srci->snaprealm &&
-      srci->find_snaprealm() != destdn->get_dir()->inode->find_snaprealm()) {
-    dout(10) << " renaming between snaprealms, creating snaprealm for " << *srci << dendl;
-    mds->mdcache->snaprealm_create(mdr, srci);
-    return;
+  if (srcdnl->is_primary() && srci->is_multiversion() && !srci->snaprealm) {
+    SnapRealm *srcrealm = srci->find_snaprealm();
+    SnapRealm *destrealm = destdn->get_dir()->inode->find_snaprealm();
+    if (srcrealm != destrealm &&
+	(srcrealm->get_newest_seq() + 1 > srcdn->first ||
+	 destrealm->get_newest_seq() + 1 > srcdn->first)) {
+      dout(10) << " renaming between snaprealms, creating snaprealm for " << *srci << dendl;
+      mds->mdcache->snaprealm_create(mdr, srci);
+      return;
+    }
   }
 
   assert(g_conf->mds_kill_rename_at != 1);
@@ -5650,6 +5656,7 @@ void Server::_rename_prepare(MDRequest *mdr,
   if (destdn->is_auth())
     mdcache->predirty_journal_parents(mdr, metablob, srci, destdn->get_dir(), flags, 1);
 
+  SnapRealm *src_realm = srci->find_snaprealm();
   SnapRealm *dest_realm = destdn->get_dir()->inode->find_snaprealm();
   snapid_t next_dest_snap = dest_realm->get_newest_seq() + 1;
 
@@ -5659,7 +5666,8 @@ void Server::_rename_prepare(MDRequest *mdr,
     if (destdnl->is_primary()) {
       if (destdn->is_auth()) {
 	// project snaprealm, too
-	oldin->project_past_snaprealm_parent(straydn->get_dir()->inode->find_snaprealm());
+	if (oldin->snaprealm || src_realm->get_newest_seq() + 1 > srcdn->first)
+	  oldin->project_past_snaprealm_parent(straydn->get_dir()->inode->find_snaprealm());
 	straydn->first = MAX(oldin->first, next_dest_snap);
 	metablob->add_primary_dentry(straydn, true, oldin);
       }
@@ -5703,7 +5711,8 @@ void Server::_rename_prepare(MDRequest *mdr,
     }
   } else if (srcdnl->is_primary()) {
     // project snap parent update?
-    if (destdn->is_auth() && srci->snaprealm)
+    if (destdn->is_auth() &&
+        (srci->snaprealm || src_realm->get_newest_seq() + 1 > srcdn->first))
       srci->project_past_snaprealm_parent(dest_realm);
     
     if (destdn->is_auth() && !destdnl->is_null())
Signature · 1 line
1.7.11.4
#12 lore raw

Re: [PATCH 12/12] mds: Avoid creating unnecessary snaprealm

Hi Yan,

This whole series looks great! Sticking it in wip-mds and running it through the fs qa suite before merging it.

How are you testing these? If you haven't seen it yet, there is an 'mds thrash exports' option that will make MDSs random migrate subtrees to each other that is great for shaking out bugs. That and periodic daemon restarts (one of the first things we need to do on the clustered mds front is to get daemon restarting integrated into teuthology).

Thanks!
sage

Quoted 84 lines · Zheng

From: "Yan, Zheng" <[email protected]>

When moving directory between snaprealms, we can avoid creating snaprealm if the directory doesn't has its own snaprealm and directory was created after both realms' newest snapshot.

---
 src/mds/Server.cc | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)
src/mds/Server.cc +17 -8
index e16800e..b706b5a 100644
@@ -4577,7 +4577,8 @@ void Server::_unlink_local(MDRequest *mdr, CDentry *dn, CDentry *straydn)
     mdcache->predirty_journal_parents(mdr, &le->metablob, in, straydn->get_dir(), PREDIRTY_PRIMARY|PREDIRTY_DIR, 1);
 
     // project snaprealm, too
-    in->project_past_snaprealm_parent(straydn->get_dir()->inode->find_snaprealm());
+    if (in->snaprealm || follows + 1 > dn->first)
+      in->project_past_snaprealm_parent(straydn->get_dir()->inode->find_snaprealm());
 
     le->metablob.add_primary_dentry(straydn, true, in);
   } else {
@@ -5247,11 +5248,16 @@ void Server::handle_client_rename(MDRequest *mdr)
   }
 
   // moving between snaprealms?
-  if (srcdnl->is_primary() && !srci->snaprealm &&
-      srci->find_snaprealm() != destdn->get_dir()->inode->find_snaprealm()) {
-    dout(10) << " renaming between snaprealms, creating snaprealm for " << *srci << dendl;
-    mds->mdcache->snaprealm_create(mdr, srci);
-    return;
+  if (srcdnl->is_primary() && srci->is_multiversion() && !srci->snaprealm) {
+    SnapRealm *srcrealm = srci->find_snaprealm();
+    SnapRealm *destrealm = destdn->get_dir()->inode->find_snaprealm();
+    if (srcrealm != destrealm &&
+	(srcrealm->get_newest_seq() + 1 > srcdn->first ||
+	 destrealm->get_newest_seq() + 1 > srcdn->first)) {
+      dout(10) << " renaming between snaprealms, creating snaprealm for " << *srci << dendl;
+      mds->mdcache->snaprealm_create(mdr, srci);
+      return;
+    }
   }
 
   assert(g_conf->mds_kill_rename_at != 1);
@@ -5650,6 +5656,7 @@ void Server::_rename_prepare(MDRequest *mdr,
   if (destdn->is_auth())
     mdcache->predirty_journal_parents(mdr, metablob, srci, destdn->get_dir(), flags, 1);
 
+  SnapRealm *src_realm = srci->find_snaprealm();
   SnapRealm *dest_realm = destdn->get_dir()->inode->find_snaprealm();
   snapid_t next_dest_snap = dest_realm->get_newest_seq() + 1;
 
@@ -5659,7 +5666,8 @@ void Server::_rename_prepare(MDRequest *mdr,
     if (destdnl->is_primary()) {
       if (destdn->is_auth()) {
 	// project snaprealm, too
-	oldin->project_past_snaprealm_parent(straydn->get_dir()->inode->find_snaprealm());
+	if (oldin->snaprealm || src_realm->get_newest_seq() + 1 > srcdn->first)
+	  oldin->project_past_snaprealm_parent(straydn->get_dir()->inode->find_snaprealm());
 	straydn->first = MAX(oldin->first, next_dest_snap);
 	metablob->add_primary_dentry(straydn, true, oldin);
       }
@@ -5703,7 +5711,8 @@ void Server::_rename_prepare(MDRequest *mdr,
     }
   } else if (srcdnl->is_primary()) {
     // project snap parent update?
-    if (destdn->is_auth() && srci->snaprealm)
+    if (destdn->is_auth() &&
+        (srci->snaprealm || src_realm->get_newest_seq() + 1 > srcdn->first))
       srci->project_past_snaprealm_parent(dest_realm);
 
     if (destdn->is_auth() && !destdnl->is_null())
Signature · 6 lines
1.7.11.4

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#13 lore raw

Re: [PATCH 12/12] mds: Avoid creating unnecessary snaprealm

Quoted 11 lines · Sage Weil

Hi Yan,

This whole series looks great! Sticking it in wip-mds and running it through the fs qa suite before merging it.

How are you testing these? If you haven't seen it yet, there is an 'mds thrash exports' option that will make MDSs random migrate subtrees to each other that is great for shaking out bugs. That and periodic daemon restarts (one of the first things we need to do on the clustered mds front is to get daemon restarting integrated into teuthology).

The patches are fixes for problems I encountered during playing MDS shutdown. I setup a 2 MDS cephfs and copied some data into it, deleted some directories whose authority is MDS.1, then shutdown MDS.1.

Most patches in this series are obvious. The two snaprealm related patches are workaround for a bug: replica inode's snaprealm->open is not true. The bug triggers assertion in CInode::pop_projected_snaprealm() if snaprealm is involved in cross authority rename.

Regards
Yan, Zheng

#14 lore raw

Re: [PATCH 12/12] mds: Avoid creating unnecessary snaprealm

Quoted 13 lines · Zheng
Quoted 11 lines · Sage Weil

Hi Yan,

This whole series looks great! Sticking it in wip-mds and running it through the fs qa suite before merging it.

How are you testing these? If you haven't seen it yet, there is an 'mds thrash exports' option that will make MDSs random migrate subtrees to each other that is great for shaking out bugs. That and periodic daemon restarts (one of the first things we need to do on the clustered mds front is to get daemon restarting integrated into teuthology).

Quoted 8 lines

The patches are fixes for problems I encountered during playing MDS shutdown. I setup a 2 MDS cephfs and copied some data into it, deleted some directories whose authority is MDS.1, then shutdown MDS.1.

Most patches in this series are obvious. The two snaprealm related patches are workaround for a bug: replica inode's snaprealm->open is not true. The bug triggers assertion in CInode::pop_projected_snaprealm() if snaprealm is involved in cross authority rename.

Do you mind opening a ticket at tracker.newdream.net so we don't lose track of it?

Fsstress on a single mds turned up this:

2012-10-02T17:09:09.359 INFO:teuthology.task.ceph.mds.a.err:*** Caught signal (Segmentation fault) **
2012-10-02T17:09:09.359 INFO:teuthology.task.ceph.mds.a.err: in thread 7f8873a41700
2012-10-02T17:09:09.361 INFO:teuthology.task.ceph.mds.a.err: ceph version 0.52-949-ge8df6a7 (commit:e8df6a74cae66accb6682129c9c5ad33797f458c)
2012-10-02T17:09:09.361 INFO:teuthology.task.ceph.mds.a.err: 1: /tmp/cephtest/binary/usr/local/bin/ceph-mds() [0x812b21]
2012-10-02T17:09:09.361 INFO:teuthology.task.ceph.mds.a.err: 2: (()+0xfcb0) [0x7f88787b3cb0]
2012-10-02T17:09:09.361 INFO:teuthology.task.ceph.mds.a.err: 3: (Server::handle_client_rename(MDRequest*)+0xa28) [0x53dc88]
2012-10-02T17:09:09.361 INFO:teuthology.task.ceph.mds.a.err: 4: (Server::dispatch_client_request(MDRequest*)+0x4fb) [0x54123b]
2012-10-02T17:09:09.361 INFO:teuthology.task.ceph.mds.a.err: 5: (Server::handle_client_request(MClientRequest*)+0x51d) [0x544a6d]
2012-10-02T17:09:09.361 INFO:teuthology.task.ceph.mds.a.err: 6: (Server::dispatch(Message*)+0x2d3) [0x5452e3]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: 7: (MDS::handle_deferrable_message(Message*)+0x91f) [0x4bc32f]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: 8: (MDS::_dispatch(Message*)+0x9b6) [0x4cf8b6]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: 9: (MDS::ms_dispatch(Message*)+0x21b) [0x4d0c3b]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: 10: (DispatchQueue::entry()+0x711) [0x7eb301]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: 11: (DispatchQueue::DispatchThread::entry()+0xd) [0x7713dd]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: 12: (()+0x7e9a) [0x7f88787abe9a]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: 13: (clone()+0x6d) [0x7f8876d534bd]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err:2012-10-02 17:09:09.349272 7f8873a41700 -1 *** Caught signal (Segmentation fault) **
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: in thread 7f8873a41700

I don't have time right now to hunt this down, but you should be able to reproduce with qa/workunits/suites/fsstress.sh on top of ceph-fuse with 1 mds.

Thanks!
sage

author
#15 lore raw

Re: [PATCH 12/12] mds: Avoid creating unnecessary snaprealm

Quoted 18 lines · Sage Weil
Quoted 17 lines · Zheng
Quoted 11 lines · Sage Weil

Hi Yan,

This whole series looks great! Sticking it in wip-mds and running it through the fs qa suite before merging it.

How are you testing these? If you haven't seen it yet, there is an 'mds thrash exports' option that will make MDSs random migrate subtrees to each other that is great for shaking out bugs. That and periodic daemon restarts (one of the first things we need to do on the clustered mds front is to get daemon restarting integrated into teuthology).

The patches are fixes for problems I encountered during playing MDS shutdown. I setup a 2 MDS cephfs and copied some data into it, deleted some directories whose authority is MDS.1, then shutdown MDS.1.

Quoted 7 lines
Quoted 4 lines

Most patches in this series are obvious. The two snaprealm related patches are workaround for a bug: replica inode's snaprealm->open is not true. The bug triggers assertion in CInode::pop_projected_snaprealm() if snaprealm is involved in cross authority rename.

Do you mind opening a ticket at tracker.newdream.net so we don't lose track of it?

will do

Quoted 22 lines

Fsstress on a single mds turned up this:

2012-10-02T17:09:09.359 INFO:teuthology.task.ceph.mds.a.err:*** Caught signal (Segmentation fault) **
2012-10-02T17:09:09.359 INFO:teuthology.task.ceph.mds.a.err: in thread 7f8873a41700
2012-10-02T17:09:09.361 INFO:teuthology.task.ceph.mds.a.err: ceph version 0.52-949-ge8df6a7 (commit:e8df6a74cae66accb6682129c9c5ad33797f458c)
2012-10-02T17:09:09.361 INFO:teuthology.task.ceph.mds.a.err: 1: /tmp/cephtest/binary/usr/local/bin/ceph-mds() [0x812b21]
2012-10-02T17:09:09.361 INFO:teuthology.task.ceph.mds.a.err: 2: (()+0xfcb0) [0x7f88787b3cb0]
2012-10-02T17:09:09.361 INFO:teuthology.task.ceph.mds.a.err: 3: (Server::handle_client_rename(MDRequest*)+0xa28) [0x53dc88]
2012-10-02T17:09:09.361 INFO:teuthology.task.ceph.mds.a.err: 4: (Server::dispatch_client_request(MDRequest*)+0x4fb) [0x54123b]
2012-10-02T17:09:09.361 INFO:teuthology.task.ceph.mds.a.err: 5: (Server::handle_client_request(MClientRequest*)+0x51d) [0x544a6d]
2012-10-02T17:09:09.361 INFO:teuthology.task.ceph.mds.a.err: 6: (Server::dispatch(Message*)+0x2d3) [0x5452e3]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: 7: (MDS::handle_deferrable_message(Message*)+0x91f) [0x4bc32f]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: 8: (MDS::_dispatch(Message*)+0x9b6) [0x4cf8b6]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: 9: (MDS::ms_dispatch(Message*)+0x21b) [0x4d0c3b]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: 10: (DispatchQueue::entry()+0x711) [0x7eb301]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: 11: (DispatchQueue::DispatchThread::entry()+0xd) [0x7713dd]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: 12: (()+0x7e9a) [0x7f88787abe9a]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: 13: (clone()+0x6d) [0x7f8876d534bd]
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err:2012-10-02 17:09:09.349272 7f8873a41700 -1 *** Caught signal (Segmentation fault) **
2012-10-02T17:09:09.362 INFO:teuthology.task.ceph.mds.a.err: in thread 7f8873a41700
Quoted 4 lines

I don't have time right now to hunt this down, but you should be able to reproduce with qa/workunits/suites/fsstress.sh on top of ceph-fuse with 1 mds.

this is a old stray reintegration bug, I just sent a patch to fix it.

Regards
Yan, Zheng

Quoted 3 lines

Thanks!
sage