From 2beb1f92f19075dca3f55125509e1857c0ffe501 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 2 Dec 2021 17:46:26 -0500 Subject: [PATCH] mon/MgrStatMonitor: do not spam subscribers (mgr) with service_map We are comparing the monmap epoch to the service_map epoch! Fixes: https://tracker.ceph.com/issues/53479 Signed-off-by: Sage Weil (cherry picked from commit d0f5ed13567f54b1bdedc388568d2afc5922ab70) Conflicts: src/mon/MgrStatMonitor.cc Cherry-pick notes: - MgrStatMonitor mon member was a pointer in Octopus --- src/mon/MgrStatMonitor.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mon/MgrStatMonitor.cc b/src/mon/MgrStatMonitor.cc index b27bf5d680a0d..4d3ecead280ae 100644 --- a/src/mon/MgrStatMonitor.cc +++ b/src/mon/MgrStatMonitor.cc @@ -305,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); @@ -317,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; } } } -- 2.39.5