From 73b591ad90674368337c4d09403a9af3a671fe98 Mon Sep 17 00:00:00 2001 From: John Spray Date: Thu, 19 Mar 2015 20:41:36 +0000 Subject: [PATCH] mds: call damaged() on what were assertions in replay i.e. categorize an unreplayable journal as a damaged rank. NB there will be other cases where replay can assert out while calling into other classes, but that's for another day. Signed-off-by: John Spray --- src/mds/journal.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/mds/journal.cc b/src/mds/journal.cc index b5bea0c87c0c1..34adbd8bbbc50 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -1169,7 +1169,9 @@ void EMetaBlob::replay(MDS *mds, LogSegment *logseg, MDSlaveUpdate *slaveup) dout(10) << "EMetaBlob.replay created base " << *diri << dendl; } else { dout(0) << "EMetaBlob.replay missing dir ino " << (*lp).ino << dendl; - assert(0); + mds->clog->error() << "failure replaying journal (EMetaBlob)"; + mds->damaged(); + assert(0); // Should be unreachable because damaged() calls respawn() } } @@ -1880,7 +1882,9 @@ void ETableServer::replay(MDS *mds) server->_server_update(mutation); break; default: - assert(0); + mds->clog->error() << "invalid tableserver op in ETableServer"; + mds->damaged(); + assert(0); // Should be unreachable because damaged() calls respawn() } assert(version == server->get_version()); @@ -2435,7 +2439,9 @@ void ESlaveUpdate::replay(MDS *mds) break; default: - assert(0); + mds->clog->error() << "invalid op in ESlaveUpdate"; + mds->damaged(); + assert(0); // Should be unreachable because damaged() calls respawn() } } @@ -2936,10 +2942,13 @@ void EImportFinish::replay(MDS *mds) mds->mdcache->try_trim_non_auth_subtree(dir); } } else { + // this shouldn't happen unless this is an old journal dout(10) << "EImportFinish.replay " << base << " success=" << success << " on subtree not marked as ambiguous" << dendl; - assert(0 == "this shouldn't happen unless this is an old journal"); + mds->clog->error() << "failure replaying journal (EImportFinish)"; + mds->damaged(); + assert(0); // Should be unreachable because damaged() calls respawn() } } -- 2.39.5