From: John Spray Date: Wed, 16 Nov 2016 22:05:22 +0000 (+0000) Subject: mds: tweak merge/split counters X-Git-Tag: v11.1.0~137^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8d5cb931afb3f56788bf5c635ca956fddcb2dffe;p=ceph.git mds: tweak merge/split counters Increment these when we have finished splitting or merging, not partway through the process. This makes testing more deterministic: once I've seen the counter increment, I'm sure that the children no longer have STATE_FRAGMENTING set as a result of their parent's split-in-progress. Signed-off-by: John Spray --- diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index 58766ae177e2e..ad161ce1b4f79 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -914,8 +914,6 @@ void CDir::split(int bits, list& subs, list& wai { dout(10) << "split by " << bits << " bits on " << *this << dendl; - if (cache->mds->logger) cache->mds->logger->inc(l_mds_dir_split); - assert(replay || is_complete() || !is_auth()); list frags; @@ -1006,8 +1004,6 @@ void CDir::merge(list& subs, list& waiters, bool { dout(10) << "merge " << subs << dendl; - if (cache->mds->logger) cache->mds->logger->inc(l_mds_dir_merge); - set_dir_auth(subs.front()->get_dir_auth()); prepare_new_fragment(replay); diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 651f4457667c6..ca03c6969e012 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -11303,7 +11303,8 @@ void MDCache::_fragment_committed(dirfrag_t basedirfrag, list& resultfrag void MDCache::_fragment_finish(dirfrag_t basedirfrag, list& resultfrags) { - dout(10) << "fragment_finish " << basedirfrag << dendl; + dout(10) << "fragment_finish " << basedirfrag << "resultfrags.size=" + << resultfrags.size() << dendl; map::iterator it = uncommitted_fragments.find(basedirfrag); assert(it != uncommitted_fragments.end()); ufragment &uf = it->second; @@ -11314,6 +11315,14 @@ void MDCache::_fragment_finish(dirfrag_t basedirfrag, list& resultfrags) (*p)->auth_unpin(this); } + if (mds->logger) { + if (resultfrags.size() > 1) { + mds->logger->inc(l_mds_dir_split); + } else { + mds->logger->inc(l_mds_dir_merge); + } + } + EFragment *le = new EFragment(mds->mdlog, EFragment::OP_FINISH, basedirfrag, uf.bits); mds->mdlog->start_submit_entry(le);