From b9526c54554d67f929e4be52864a73aab656bacc Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Thu, 13 Jul 2017 15:12:21 +0800 Subject: [PATCH] mon/OSDMonitor: cleanup last_osd_report if osd does not exist In case we might want to reuse the same slot later. Signed-off-by: xie xingguo --- src/mon/OSDMonitor.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 93194e097ac..8056c140a38 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -3329,6 +3329,10 @@ bool OSDMonitor::handle_osd_timeouts(const utime_t &now, for (int i=0; i < max_osd; ++i) { dout(30) << __func__ << ": checking up on osd " << i << dendl; + if (!osdmap.exists(i)) { + last_osd_report.erase(i); // if any + continue; + } if (!osdmap.is_up(i)) continue; const std::map::const_iterator t = last_osd_report.find(i); -- 2.39.5