From: xie xingguo Date: Thu, 13 Jul 2017 07:12:21 +0000 (+0800) Subject: mon/OSDMonitor: cleanup last_osd_report if osd does not exist X-Git-Tag: ses5-milestone9~1^2~13^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b9526c54554d67f929e4be52864a73aab656bacc;p=ceph.git 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 --- 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);