From 44d24de656440a010b3fbd0dd371a0a1519e5576 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 2 Jun 2009 11:44:37 -0700 Subject: [PATCH] mds: no early reply when request has slaves 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 | 4 ++++ src/mds/Server.cc | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index 0d0c6c6253729..e7ade93d918a8 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -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() { diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 8d0b0b82a8323..ad1e314dcd789 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -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; -- 2.39.5