]> 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)
committerGreg Farnum <greg@inktank.com>
Mon, 14 Oct 2013 16:40:31 +0000 (09:40 -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>
(cherry picked from commit d2cb2bf6bac83ac6db9df6cb876317d30e7493cc)
Reviewed-by: Greg Farnum <greg@inktank.com>
src/mds/MDLog.cc

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