From 76635a474561636854e62c8b9a3b5064b2f311a4 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Tue, 10 Nov 2009 16:02:04 -0800 Subject: [PATCH] mds: If last MDS, suicide on stop rather than entering infinite requeue loop --- src/mds/MDS.cc | 9 +++++++++ src/mds/journal.cc | 1 + 2 files changed, 10 insertions(+) diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc index 12d4284b821b0..30c046899cd9f 100644 --- a/src/mds/MDS.cc +++ b/src/mds/MDS.cc @@ -1084,6 +1084,12 @@ void MDS::stopping_start() { dout(2) << "stopping_start" << dendl; + if (mdsmap.get_num_mds() == 1) { + //we're the only mds up! + dout(0) << "We are the last MDS in cluster! Suiciding!" << dendl; + suicide(); + } + // start cache shutdown mdcache->shutdown_start(); @@ -1381,6 +1387,9 @@ bool MDS::_dispatch(Message *m) dout(7) << "shutdown_pass=true, finished w/ shutdown, moving to down:stopped" << dendl; stopping_done(); } + else { + dout(7) << "shutdown_pass=false" << dendl; + } } return true; } diff --git a/src/mds/journal.cc b/src/mds/journal.cc index e4b301827ebec..f5b8f4b83662e 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -157,6 +157,7 @@ C_Gather *LogSegment::try_to_expire(MDS *mds) assert(!mds->mdlog->is_capped()); // hmm FIXME EOpen *le = 0; LogSegment *ls = mds->mdlog->get_current_segment(); + assert(ls != this); xlist::iterator p = open_files.begin(); while (!p.end()) { CInode *in = *p; -- 2.39.5