From: Yan, Zheng Date: Sat, 29 Mar 2014 02:36:12 +0000 (+0800) Subject: mds: find approximal bounds when adjusting subtree auth X-Git-Tag: v0.79~52^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b71e64dd68021c243ad2ac751c69bbd4d81c3f2f;p=ceph.git 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. --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 9e9a835ee5974..c457750647d5c 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); }