]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: cleanup last_osd_report if osd does not exist
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 13 Jul 2017 07:12:21 +0000 (15:12 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 17 Jul 2017 13:49:42 +0000 (21:49 +0800)
In case we might want to reuse the same slot later.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/mon/OSDMonitor.cc

index 93194e097ac150519b258e456e615b734d253a36..8056c140a3805b46f42fa9c21a9f683a80957e05 100644 (file)
@@ -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<int,utime_t>::const_iterator t = last_osd_report.find(i);