Skip to content

Commit

Permalink
mds: handle blacklisting during journal recovery
Browse files Browse the repository at this point in the history
EBLACKLISTED was being incorrectly handled as an
indication of metadata damage.

Fixes: http://tracker.ceph.com/issues/17236
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit 19bb8c0)
  • Loading branch information
John Spray authored and ldachary committed Nov 9, 2016
1 parent bcf2289 commit 0a5713c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/mds/MDLog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,10 @@ void MDLog::_recovery_thread(MDSInternalContextBase *completion)
int write_result = jp.save(mds->objecter);
// Nothing graceful we can do for this
assert(write_result >= 0);
} else if (read_result == -EBLACKLISTED) {
derr << "Blacklisted during JournalPointer read! Respawning..." << dendl;
mds->respawn();
assert(0); // Should be unreachable because respawn calls execv
} else if (read_result != 0) {
mds->clog->error() << "failed to read JournalPointer: " << read_result
<< " (" << cpp_strerror(read_result) << ")";
Expand All @@ -936,7 +940,11 @@ void MDLog::_recovery_thread(MDSInternalContextBase *completion)
C_SaferCond recover_wait;
back.recover(&recover_wait);
int recovery_result = recover_wait.wait();
if (recovery_result != 0) {
if (recovery_result == -EBLACKLISTED) {
derr << "Blacklisted during journal recovery! Respawning..." << dendl;
mds->respawn();
assert(0); // Should be unreachable because respawn calls execv
} else if (recovery_result != 0) {
// Journaler.recover succeeds if no journal objects are present: an error
// means something worse like a corrupt header, which we can't handle here.
mds->clog->error() << "Error recovering journal " << jp.front << ": "
Expand Down Expand Up @@ -979,7 +987,11 @@ void MDLog::_recovery_thread(MDSInternalContextBase *completion)
int recovery_result = recover_wait.wait();
dout(4) << "Journal " << jp.front << " recovered." << dendl;

if (recovery_result != 0) {
if (recovery_result == -EBLACKLISTED) {
derr << "Blacklisted during journal recovery! Respawning..." << dendl;
mds->respawn();
assert(0); // Should be unreachable because respawn calls execv
} else if (recovery_result != 0) {
mds->clog->error() << "Error recovering journal " << jp.front << ": "
<< cpp_strerror(recovery_result);
mds->damaged_unlocked();
Expand Down

0 comments on commit 0a5713c

Please sign in to comment.