PG: use clear_location() to clear out missing_loc

Signed-off-by: Neha Ojha <nojha@redhat.com>
This commit is contained in:
Neha Ojha 2018-03-14 17:32:47 -07:00
parent 80c57b1ccd
commit e68f2f0ff0
2 changed files with 10 additions and 7 deletions

View File

@ -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<hobject_t, pg_missing_item>::const_iterator i =
missing.get_items().begin();

View File

@ -10125,13 +10125,7 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx)
if (requires_missing_loc) {
// clear out missing_loc
set<pg_shard_t> peers(missing_loc.get_locations(soid));
for (set<pg_shard_t>::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<pg_shard_t>::const_iterator i = actingset.begin();
i != actingset.end();
++i) {