]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: send no_reply() to peon to drop ignored mdsbeacon
authorKefu Chai <kchai@redhat.com>
Tue, 2 Jun 2015 04:55:06 +0000 (12:55 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 3 Jun 2015 06:14:23 +0000 (23:14 -0700)
so the peon can remove the ignored mdsbeacon request from the
routed_requets at seeing this reply, and hence no longer resend the
request.

Fixes: #11590
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/MDSMonitor.cc
src/mon/MDSMonitor.h

index 3d00edd99c544b5e48741220b165bf28ec32b4e5..f368d1b4d5fbc8ada28854fd1000b9e5406be08b 100644 (file)
@@ -291,7 +291,8 @@ bool MDSMonitor::preprocess_beacon(MMDSBeacon *m)
     if (state != MDSMap::STATE_BOOT) {
       dout(7) << "mds_beacon " << *m << " is not in mdsmap" << dendl;
       mon->send_reply(m, new MMDSMap(mon->monmap->fsid, &mdsmap));
-      goto out;
+      m->put();
+      return true;
     } else {
       return false;  // not booted yet.
     }
@@ -358,9 +359,12 @@ bool MDSMonitor::preprocess_beacon(MMDSBeacon *m)
   mon->send_reply(m,
                  new MMDSBeacon(mon->monmap->fsid, m->get_global_id(), m->get_name(),
                                 mdsmap.get_epoch(), state, seq));
-  
-  // done
+  m->put();
+  return true;
+
  out:
+  // I won't reply this beacon, drop it.
+  mon->no_reply(m);
   m->put();
   return true;
 }
index 88bf69a48fc7de89c2a1237beed637500d8fb87e..220da972fc4f446e1475c657ae35f4a970743a01 100644 (file)
@@ -58,10 +58,12 @@ class MDSMonitor : public PaxosService {
     void finish(int r) {
       if (r >= 0)
        mm->_updated(m);   // success
-      else if (r == -ECANCELED)
+      else if (r == -ECANCELED) {
+       mm->mon->no_reply(m);
        m->put();
-      else
+      } else {
        mm->dispatch((PaxosServiceMessage*)m);        // try again
+      }
     }
   };