From: Neha Ojha Date: Wed, 21 Feb 2018 04:57:20 +0000 (-0800) Subject: PG: add location to missing_loc only during async_recovery X-Git-Tag: v13.1.0~548^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8cf08f3ab8803affb3fb470779f1d8b739be8ada;p=ceph.git PG: add location to missing_loc only during async_recovery Signed-off-by: Neha Ojha --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 2df6297b468d..7f9bd5cdb08f 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -10077,10 +10077,12 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx) ++i) { dout(10) << __func__ << " shard " << i->first << " before missing " << (i->second).get_items() << dendl; } + bool requires_missing_loc = false; for (set::iterator i = async_recovery_targets.begin(); i != async_recovery_targets.end(); ++i) { if (*i == get_primary() || !peer_missing[*i].is_missing(soid)) continue; + requires_missing_loc = true; for (auto &&entry: ctx->log) { peer_missing[*i].add_next_event(entry); } @@ -10114,12 +10116,14 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx) missing_loc.remove_location(soid, peer); } - for (set::const_iterator i = actingset.begin(); - i != actingset.end(); - ++i) { - pg_shard_t peer(*i); - if (!peer_missing[peer].is_missing(soid)) - missing_loc.add_location(soid, peer); + if (requires_missing_loc) { + for (set::const_iterator i = actingset.begin(); + i != actingset.end(); + ++i) { + pg_shard_t peer(*i); + if (!peer_missing[peer].is_missing(soid)) + missing_loc.add_location(soid, peer); + } } dout(10) << __func__ << " missing_loc after: " << missing_loc.get_locations(soid) << dendl;