From: John Spray Date: Thu, 17 Nov 2016 23:19:33 +0000 (+0000) Subject: mds: fix fragment thrasher X-Git-Tag: v11.1.0~137^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aba7aa6ae34cbb9d94c87e722050c1e9d40dd534;p=ceph.git mds: fix fragment thrasher The allows_dirfrags() test was in the wrong place, causing in some cases a root fragment to be passed into queue_merge. Signed-off-by: John Spray --- diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index 88359db69da7..7a51ed02ad0a 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -520,11 +520,13 @@ bool MDSRank::_dispatch(Message *m, bool new_msg) if (!dir->get_parent_dir()) continue; // must be linked. if (!dir->is_auth()) continue; // must be auth. frag_t fg = dir->get_frag(); - if (mdsmap->allows_dirfrags() && - (fg == frag_t() || (rand() % (1 << fg.bits()) == 0))) - mdcache->split_dir(dir, 1); - else - balancer->queue_merge(dir); + if (mdsmap->allows_dirfrags()) { + if ((fg == frag_t() || (rand() % (1 << fg.bits()) == 0))) { + mdcache->split_dir(dir, 1); + } else { + balancer->queue_merge(dir); + } + } } // hack: force hash root?