diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2013-10-02 11:43:12 +0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-10-01 21:10:56 -0700 |
commit | d2cb2bf6bac83ac6db9df6cb876317d30e7493cc (patch) | |
tree | 8380ab0c48bd74751454d148fc36f0afec8ba631 | |
parent | fbeabccaf060fa79a65ffa61a0a1ac40100e1451 (diff) | |
download | ceph-d2cb2bf6bac83ac6db9df6cb876317d30e7493cc.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>
-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 bd89da71495..cacbebfd3f6 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -499,7 +499,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()); |