]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: drop entry in failure_pending when resetting stale peer 40558/head
authorKefu Chai <kchai@redhat.com>
Sun, 14 Mar 2021 03:56:59 +0000 (11:56 +0800)
committersinguliere <singuliere@autistici.org>
Thu, 1 Apr 2021 21:07:12 +0000 (23:07 +0200)
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 466153e4295397da173c26a632bcfec8331a9c8b..c95765e62c273cc174b47a4b4abea2911841ffcc 100644 (file)
@@ -5201,14 +5201,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;
     }
   }
 }