diff --git a/fdbrpc/HealthMonitor.actor.cpp b/fdbrpc/HealthMonitor.actor.cpp index bf03370fd2..fa549a50f2 100644 --- a/fdbrpc/HealthMonitor.actor.cpp +++ b/fdbrpc/HealthMonitor.actor.cpp @@ -29,10 +29,12 @@ void HealthMonitor::reportPeerClosed(const NetworkAddress& peerAddress) { } void HealthMonitor::purgeOutdatedHistory() { - for (auto it : peerClosedHistory) { - if (it.first < now() - FLOW_KNOBS->HEALTH_MONITOR_CLIENT_REQUEST_INTERVAL_SECS) { - peerClosedNum[it.second] -= 1; - ASSERT(peerClosedNum[it.second] >= 0); + for (auto it = peerClosedHistory.begin(); it != peerClosedHistory.end();) { + if (it->first < now() - FLOW_KNOBS->HEALTH_MONITOR_CLIENT_REQUEST_INTERVAL_SECS) { + auto& count = peerClosedNum[it->second]; + --count; + ASSERT(count >= 0); + ++it; // Increment before pop_front to avoid iterator invalidation peerClosedHistory.pop_front(); } else { break; diff --git a/fdbserver/MoveKeys.actor.cpp b/fdbserver/MoveKeys.actor.cpp index eea20328cd..32a044f613 100644 --- a/fdbserver/MoveKeys.actor.cpp +++ b/fdbserver/MoveKeys.actor.cpp @@ -240,7 +240,6 @@ ACTOR Future>> additionalSources(Standalone s std::map ssiMap; for(int s=0; s>> additionalSources(Standalone s } for(int s=0; s