mds: Adjust mydir auth when starting MDS that was stopped cleanly
PATCH v3 1/1 mds: Adjust mydir auth when starting MDS that was stopped cleanly
From: "Yan, Zheng" <[email protected]>
When starting a MDS that was stopped cleanly, we need manually adjust mydir's auth. This is because MDS log is empty in this case, mydir's auth can not be adjusted during log replay.
Signed-off-by Yan, Zheng <[email protected]>
--- src/mds/MDCache.cc | 1 + src/mds/MDS.cc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)
src/mds/MDCache.cc +1 -0
@@ -565,6 +565,7 @@ void MDCache::open_root() } CDir *mydir = myin->get_or_open_dirfrag(this, frag_t()); assert(mydir); + adjust_subtree_auth(mydir, mds->whoami); populate_mydir(); }
src/mds/MDS.cc +2 -2
@@ -1229,10 +1229,10 @@ void MDS::starting_done() assert(is_starting()); request_state(MDSMap::STATE_ACTIVE); + mdcache->open_root(); + // start new segment mdlog->start_new_segment(0); - - mdcache->open_root(); }
Signature · 1 line
1.7.11.4
Sage Weil
AppliedApplied, thanks!
sage
Quoted 45 lines · Zheng
From: "Yan, Zheng" <[email protected]>
When starting a MDS that was stopped cleanly, we need manually adjust mydir's auth. This is because MDS log is empty in this case, mydir's auth can not be adjusted during log replay.
Signed-off-by Yan, Zheng <[email protected]>--- src/mds/MDCache.cc | 1 + src/mds/MDS.cc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)src/mds/MDCache.cc +1
-0@@ -565,6 +565,7 @@ void MDCache::open_root() } CDir *mydir = myin->get_or_open_dirfrag(this, frag_t()); assert(mydir); + adjust_subtree_auth(mydir, mds->whoami); populate_mydir(); }src/mds/MDS.cc +2
-2@@ -1229,10 +1229,10 @@ void MDS::starting_done() assert(is_starting()); request_state(MDSMap::STATE_ACTIVE); + mdcache->open_root(); + // start new segment mdlog->start_new_segment(0); - - mdcache->open_root(); }Signature · 1 line
1.7.11.4