mirror of
https://github.com/ceph/ceph
synced 2025-04-22 15:26:10 +00:00
mds: set dir_auth between EImport{Start,Finish}
This ensures that try_trim_non_auth_subtree() doesn't throw out a subtree we're in the midst of importing (during journal replay). Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
a47c225062
commit
a01fba175b
@ -696,6 +696,10 @@ public:
|
||||
bool have_ambiguous_import(dirfrag_t base) {
|
||||
return my_ambiguous_imports.count(base);
|
||||
}
|
||||
void get_ambiguous_import_bounds(dirfrag_t base, vector<dirfrag_t>& bounds) {
|
||||
assert(my_ambiguous_imports.count(base));
|
||||
bounds = my_ambiguous_imports[base];
|
||||
}
|
||||
void cancel_ambiguous_import(dirfrag_t dirino);
|
||||
void finish_ambiguous_import(dirfrag_t dirino);
|
||||
void resolve_start();
|
||||
|
@ -1084,6 +1084,10 @@ void EImportStart::replay(MDS *mds)
|
||||
// put in ambiguous import list
|
||||
mds->mdcache->add_ambiguous_import(base, bounds);
|
||||
|
||||
// set auth partially to us so we don't trim it
|
||||
CDir *dir = mds->mdcache->get_dirfrag(base);
|
||||
mds->mdcache->adjust_bounded_subtree_auth(dir, bounds, pair<int,int>(mds->get_nodeid(), mds->get_nodeid()));
|
||||
|
||||
// open client sessions?
|
||||
if (mds->sessionmap.version >= cmapv) {
|
||||
dout(10) << "EImportStart.replay sessionmap " << mds->sessionmap.version
|
||||
@ -1110,8 +1114,14 @@ void EImportFinish::replay(MDS *mds)
|
||||
dout(10) << "EImportFinish.replay " << base << " success=" << success << dendl;
|
||||
if (success)
|
||||
mds->mdcache->finish_ambiguous_import(base);
|
||||
else
|
||||
else {
|
||||
CDir *dir = mds->mdcache->get_dirfrag(base);
|
||||
vector<dirfrag_t> bounds;
|
||||
mds->mdcache->get_ambiguous_import_bounds(base, bounds);
|
||||
mds->mdcache->adjust_bounded_subtree_auth(dir, bounds, pair<int,int>(CDIR_AUTH_UNKNOWN, CDIR_AUTH_UNKNOWN));
|
||||
mds->mdcache->cancel_ambiguous_import(base);
|
||||
mds->mdcache->try_trim_non_auth_subtree(dir);
|
||||
}
|
||||
} else {
|
||||
dout(10) << "EImportFinish.replay " << base << " success=" << success
|
||||
<< ", predates my subtree_map start point, ignoring"
|
||||
|
Loading…
Reference in New Issue
Block a user