X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fmon%2FMgrStatMonitor.cc;fp=ceph%2Fsrc%2Fmon%2FMgrStatMonitor.cc;h=4d3ecead280ae4d360dbff4b354c9d2a717b6572;hb=d0fc7ad3c015b94f3c8d84efe88b217a37a6e4ff;hp=854bc0e090a1326941f7d124b913a257100c64a3;hpb=efc1e7ef13525f02d58d97ccd62fec325323c618;p=ceph.git diff --git a/ceph/src/mon/MgrStatMonitor.cc b/ceph/src/mon/MgrStatMonitor.cc index 854bc0e09..4d3ecead2 100644 --- a/ceph/src/mon/MgrStatMonitor.cc +++ b/ceph/src/mon/MgrStatMonitor.cc @@ -3,6 +3,7 @@ #include "MgrStatMonitor.h" #include "mon/OSDMonitor.h" +#include "mon/MgrMonitor.h" #include "mon/PGMap.h" #include "messages/MGetPoolStats.h" #include "messages/MGetPoolStatsReply.h" @@ -184,7 +185,14 @@ bool MgrStatMonitor::prepare_update(MonOpRequestRef op) bool MgrStatMonitor::preprocess_report(MonOpRequestRef op) { + auto m = op->get_req(); mon->no_reply(op); + if (m->gid && + m->gid != mon->mgrmon()->get_map().get_active_gid()) { + dout(10) << "ignoring report from non-active mgr " << m->gid + << dendl; + return true; + } return false; } @@ -297,10 +305,9 @@ bool MgrStatMonitor::preprocess_statfs(MonOpRequestRef op) void MgrStatMonitor::check_sub(Subscription *sub) { - const auto epoch = mon->monmap->get_epoch(); dout(10) << __func__ << " next " << sub->next - << " have " << epoch << dendl; + << " vs service_map.epoch " << service_map.epoch << dendl; if (sub->next <= service_map.epoch) { auto m = new MServiceMap(service_map); sub->session->con->send_message(m); @@ -309,7 +316,7 @@ void MgrStatMonitor::check_sub(Subscription *sub) session_map.remove_sub(sub); }); } else { - sub->next = epoch + 1; + sub->next = service_map.epoch + 1; } } }