From 3a7d668477ac69dad5b3350763105bb1e90c42f3 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Wed, 30 Apr 2014 13:45:31 +0800 Subject: [PATCH] mds: allow early reply when request's witness list is empty Early reply should be Ok when there were slave requests, but all of them were for acquiring locks. Signed-off-by: Yan, Zheng --- src/mds/Locker.cc | 4 +++- src/mds/Mutation.cc | 4 ++-- src/mds/Mutation.h | 2 +- src/mds/Server.cc | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index e5fe00c2a6794..4f6140dfa6281 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -515,10 +515,12 @@ void Locker::set_xlocks_done(MutationImpl *mut, bool skip_dentry) for (set::iterator p = mut->xlocks.begin(); p != mut->xlocks.end(); ++p) { + MDSCacheObject *object = (*p)->get_parent(); + assert(object->is_auth()); if (skip_dentry && ((*p)->get_type() == CEPH_LOCK_DN || (*p)->get_type() == CEPH_LOCK_DVERSION)) continue; - dout(10) << "set_xlocks_done on " << **p << " " << *(*p)->get_parent() << dendl; + dout(10) << "set_xlocks_done on " << **p << " " << *object << dendl; (*p)->set_xlock_done(); } } diff --git a/src/mds/Mutation.cc b/src/mds/Mutation.cc index ffeb066b6bd04..a733b3358e70e 100644 --- a/src/mds/Mutation.cc +++ b/src/mds/Mutation.cc @@ -197,9 +197,9 @@ bool MDRequestImpl::has_more() return _more; } -bool MDRequestImpl::are_slaves() +bool MDRequestImpl::has_witnesses() { - return _more && !_more->slaves.empty(); + return _more && !_more->witnessed.empty(); } bool MDRequestImpl::slave_did_prepare() diff --git a/src/mds/Mutation.h b/src/mds/Mutation.h index dbfbe7595b0ae..87bf3df332b25 100644 --- a/src/mds/Mutation.h +++ b/src/mds/Mutation.h @@ -295,7 +295,7 @@ struct MDRequestImpl : public MutationImpl { More* more(); bool has_more(); - bool are_slaves(); + bool has_witnesses(); bool slave_did_prepare(); bool did_ino_allocation(); bool freeze_auth_pin(CInode *inode); diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 407ceed31e118..98617f17f48f7 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -825,8 +825,8 @@ void Server::early_reply(MDRequestRef& 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; + if (mdr->has_witnesses()) { + dout(10) << "early_reply - there are witnesses, not allowed." << dendl; mds->mdlog->flush(); return; } -- 2.39.5