]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: return -EAGAIN if standby replay falls behind
authorYan, Zheng <zheng.z.yan@intel.com>
Wed, 2 Oct 2013 03:43:12 +0000 (11:43 +0800)
committerSage Weil <sage@inktank.com>
Wed, 2 Oct 2013 04:10:56 +0000 (21:10 -0700)
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>
src/mds/MDLog.cc

index bd89da714952866fbc79d5f3991a2e872680417b..cacbebfd3f66e6cf1d60b08e2dece6d62315c7a8 100644 (file)
@@ -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());