diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2013-10-02 11:43:12 +0800 |
---|---|---|
committer | Greg Farnum <greg@inktank.com> | 2013-10-14 09:40:31 -0700 |
commit | cd1c3c9e00e90b19e83c1f11a48e516a7de93665 (patch) | |
tree | 75271a5226c81573b2e0f03bc0aa6c4bd5af0671 | |
parent | bd073eeac28d8cba969e5746c5e6adcb95820fdf (diff) | |
download | ceph-cd1c3c9e00e90b19e83c1f11a48e516a7de93665.tar.gz |
mds: return -EAGAIN if standby replay falls behind
standby replay may fall behind and get -ENOENT when reading the
journal. return -EAGAIN in this case, it makes the MDS respawn itself.
fixes: #5458
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit d2cb2bf6bac83ac6db9df6cb876317d30e7493cc)
Reviewed-by: Greg Farnum <greg@inktank.com>
-rw-r--r-- | src/mds/MDLog.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mds/MDLog.cc b/src/mds/MDLog.cc index b293c4cc10a..f411cb274a2 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -493,7 +493,11 @@ void MDLog::_replay_thread() if (journaler->get_error()) { r = journaler->get_error(); dout(0) << "_replay journaler got error " << r << ", aborting" << dendl; - if (r == -EINVAL) { + if (r == -ENOENT) { + // journal has been trimmed by somebody else? + assert(journaler->is_readonly()); + r = -EAGAIN; + } else if (r == -EINVAL) { if (journaler->get_read_pos() < journaler->get_expire_pos()) { // this should only happen if you're following somebody else assert(journaler->is_readonly()); |