From a03968ad584a3ff8e351cc5dce053e535fcdc454 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 2 Jun 2015 12:55:06 +0800 Subject: [PATCH] mon: send no_reply() to peon to drop ignored mdsbeacon 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 (cherry picked from commit 72a37b3a8e145d8522ea67fc14ce2c5510b6852b) --- src/mon/MDSMonitor.cc | 10 +++++++--- src/mon/MDSMonitor.h | 6 ++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index fc21436101609..b9e28d284a0ec 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -289,7 +289,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. } @@ -356,9 +357,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; } diff --git a/src/mon/MDSMonitor.h b/src/mon/MDSMonitor.h index 9a0dcdaa3b80a..5b858ee5aa709 100644 --- a/src/mon/MDSMonitor.h +++ b/src/mon/MDSMonitor.h @@ -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 + } } }; -- 2.39.5