diff --git a/src/osd/PG.h b/src/osd/PG.h index 1a8d012f759..8c8b8e4b3f0 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -782,6 +782,15 @@ protected: _inc_count(p->second); } } + + void clear_location(const hobject_t &hoid) { + auto p = missing_loc.find(hoid); + if (p != missing_loc.end()) { + _dec_count(p->second); + missing_loc.erase(p); + } + } + void add_active_missing(const pg_missing_t &missing) { for (map::const_iterator i = missing.get_items().begin(); diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 5f45e0245fd..9395a89a4a5 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -10125,13 +10125,7 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx) if (requires_missing_loc) { // clear out missing_loc - set peers(missing_loc.get_locations(soid)); - for (set::iterator r = peers.begin(); - r != peers.end(); - ++r) { - pg_shard_t peer(*r); - missing_loc.remove_location(soid, peer); - } + missing_loc.clear_location(soid); for (set::const_iterator i = actingset.begin(); i != actingset.end(); ++i) {