From b71e64dd68021c243ad2ac751c69bbd4d81c3f2f Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Sat, 29 Mar 2014 10:36:12 +0800 Subject: [PATCH] mds: find approximal bounds when adjusting subtree auth When finishing exporting a subtree, the exporter MDS drops locks and sends MExportDirFinish message to the importer MDS. The bounds of subtree can get fragmented by third party before the importer MDS receives the MExportDirFinish message. So the importer MDS can add inaccurate bounds to the EImportFinish event. The fix is find approximal bounds when finishing ambiguous imports. --- src/mds/MDCache.cc | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 9e9a835ee597..c457750647d5 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -1084,24 +1084,13 @@ void MDCache::get_force_dirfrag_bound_set(vector& dfs, set& bo } } - void MDCache::adjust_bounded_subtree_auth(CDir *dir, vector& bound_dfs, pair auth) { dout(7) << "adjust_bounded_subtree_auth " << dir->get_dir_auth() << " -> " << auth - << " on " << *dir - << " bound_dfs " << bound_dfs - << dendl; - - // make bounds list + << " on " << *dir << " bound_dfs " << bound_dfs << dendl; + set bounds; - for (vector::iterator p = bound_dfs.begin(); - p != bound_dfs.end(); - ++p) { - CDir *bd = get_dirfrag(*p); - if (bd) - bounds.insert(bd); - } - + get_force_dirfrag_bound_set(bound_dfs, bounds); adjust_bounded_subtree_auth(dir, bounds, auth); } @@ -2997,11 +2986,7 @@ void MDCache::handle_resolve(MMDSResolve *m) CDir *dir = get_force_dirfrag(pi->first); if (!dir) continue; - - set bounds; - get_force_dirfrag_bound_set(pi->second, bounds); - - adjust_bounded_subtree_auth(dir, bounds, from); + adjust_bounded_subtree_auth(dir, pi->second, from); try_subtree_merge(dir); } -- 2.47.3