]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: drop entry in failure_pending when resetting stale peer 41090/head
authorKefu Chai <kchai@redhat.com>
Sun, 14 Mar 2021 03:56:59 +0000 (11:56 +0800)
committerNeha Ojha <nojha@redhat.com>
Thu, 29 Apr 2021 17:40:51 +0000 (17:40 +0000)
no need to keep it in the pending list anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit ff077fc3ea7d1595679c7053cda3b16d68aefd01)

src/osd/OSD.cc

index 121190f409549a87b89ee2b67c3ca0c405cae59c..b90042f3bfcebbad51dfd9049b28a501cfc2911f 100644 (file)
@@ -5313,14 +5313,15 @@ void OSD::reset_heartbeat_peers(bool all)
   stale -= cct->_conf.get_val<int64_t>("osd_heartbeat_stale");
   std::lock_guard l(heartbeat_lock);
   for (auto it = heartbeat_peers.begin(); it != heartbeat_peers.end();) {
-    HeartbeatInfo& hi = it->second;
+    auto& [peer, hi] = *it;
     if (all || hi.is_stale(stale)) {
       hi.clear_mark_down();
       // stop sending failure_report to mon too
-      failure_queue.erase(it->first);
-      heartbeat_peers.erase(it++);
+      failure_queue.erase(peer);
+      failure_pending.erase(peer);
+      it = heartbeat_peers.erase(it);
     } else {
-      it++;
+      ++it;
     }
   }
 }