]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: no early reply when request has slaves
authorSage Weil <sage@newdream.net>
Tue, 2 Jun 2009 18:44:37 +0000 (11:44 -0700)
committerSage Weil <sage@newdream.net>
Tue, 2 Jun 2009 18:44:37 +0000 (11:44 -0700)
Doing an early reply when there are slaves means we need to be able to
reliably replay that op as well, and the complexity needed to do that
when we're locking stuff on multiple MDS's is so not worth it.  These
ops are pretty rare anyway.

src/mds/MDCache.h
src/mds/Server.cc

index 0d0c6c625372915ed3eaa3236c139b8218036246..e7ade93d918a8fbca826ae0ba6f3cd3e4c3075af 100644 (file)
@@ -357,6 +357,10 @@ struct MDRequest : public Mutation {
     return _more;
   }
 
+  bool are_slaves() {
+    return _more && !_more->slaves.empty();
+  }
+
   bool slave_did_prepare() { return more()->slave_commit; }
 
   bool did_ino_allocation() {
index 8d0b0b82a8323e54dd739ddf5ceb173fb9727176..ad1e314dcd789bf2d823ebbb3ca625de1913713e 100644 (file)
@@ -601,6 +601,12 @@ void Server::early_reply(MDRequest *mdr, CInode *tracei, CDentry *tracedn)
   if (!g_conf.mds_early_reply)
     return;
 
+  if (mdr->are_slaves()) {
+    dout(10) << "early_reply - there are slaves, not allowed." << dendl;
+    mds->mdlog->flush();
+    return; 
+  }
+
   if (mdr->alloc_ino) {
     dout(10) << "early_reply - allocated ino, not allowed" << dendl;
     return;