mds: handle case where rank 0 has no subtrees

Previously we always asked for STOPPING in this case,
but in the case of rank 0 it's definitely an error
condition indicating repair is needed.

Signed-off-by: John Spray <john.spray@redhat.com>
This commit is contained in:
John Spray 2015-04-30 11:43:21 +01:00
parent 7252975ef8
commit 69a54e7bb4

View File

@ -2249,8 +2249,15 @@ void MDS::rejoin_done()
// funny case: is our cache empty? no subtrees?
if (!mdcache->is_subtrees()) {
dout(1) << " empty cache, no subtrees, leaving cluster" << dendl;
request_state(MDSMap::STATE_STOPPED);
if (whoami == 0) {
// The root should always have a subtree!
clog->error() << "No subtrees found for root MDS rank!";
damaged();
assert(mdcache->is_subtrees());
} else {
dout(1) << " empty cache, no subtrees, leaving cluster" << dendl;
request_state(MDSMap::STATE_STOPPED);
}
return;
}