From a1be6c96470b843d46754ffda08c524a3c7b9a59 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Wed, 13 Sep 2017 15:55:46 +0800 Subject: [PATCH] mds: optimize MDCache::rejoin_scour_survivor_replicas() avoid iterating dentries if dirfrag is non-auth Signed-off-by: "Yan, Zheng" (cherry picked from commit d32a2376047bc1363b9f7a2ed09060ec84c78b97) --- src/mds/MDCache.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 9c718d459aed..c3a29e56efa4 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -4560,9 +4560,10 @@ void MDCache::rejoin_scour_survivor_replicas(mds_rank_t from, MMDSCacheRejoin *a p != dfs.end(); ++p) { CDir *dir = *p; + if (!dir->is_auth()) + continue; - if (dir->is_auth() && - dir->is_replica(from) && + if (dir->is_replica(from) && (ack == NULL || ack->strong_dirfrags.count(dir->dirfrag()) == 0)) { dir->remove_replica(from); dout(10) << " rem " << *dir << dendl; -- 2.47.3