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 Nov 23, 2017
1 parent c00944c commit 010f247
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/osd/PG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5014,22 +5014,23 @@ 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),
PastIntervals()));
osd->send_message_osd_cluster(peer.osd, m, get_osdmap()->get_epoch());
osd->send_message_osd_cluster(pg_shard.osd, m, get_osdmap()->get_epoch());
}
}

Expand Down

0 comments on commit 010f247

Please sign in to comment.