Skip to content

Commit

Permalink
osd/PG: avoid excessive lookups in share_pg_info()
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
  • Loading branch information
ifed01 committed Dec 7, 2017
1 parent 42f6f24 commit fb25f68
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/osd/PG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5076,17 +5076,18 @@ void PG::share_pg_info()
i != actingbackfill.end();
++i) {
if (*i == pg_whoami) continue;
pg_shard_t peer = *i;
if (peer_info.count(peer)) {
peer_info[peer].last_epoch_started = info.last_epoch_started;
peer_info[peer].last_interval_started = info.last_interval_started;
peer_info[peer].history.merge(info.history);
auto pg_shard = *i;
auto peer = peer_info.find(pg_shard);
if (peer != peer_info.end()) {
peer->second.last_epoch_started = info.last_epoch_started;
peer->second.last_interval_started = info.last_interval_started;
peer->second.history.merge(info.history);
}
MOSDPGInfo *m = new MOSDPGInfo(get_osdmap()->get_epoch());
m->pg_list.push_back(
make_pair(
pg_notify_t(
peer.shard, pg_whoami.shard,
pg_shard.shard, pg_whoami.shard,
get_osdmap()->get_epoch(),
get_osdmap()->get_epoch(),
info),
Expand Down

0 comments on commit fb25f68

Please sign in to comment.