Skip to content

Commit

Permalink
Merge pull request #17239 from zmedico/PGPool-update-eliminate-expens…
Browse files Browse the repository at this point in the history
…ive-union_of

osd/PG: PGPool::update: avoid expensive union_of

Reviewed-by: Sage Weil <sage@redhat.com>
  • Loading branch information
yuriw committed Aug 29, 2017
2 parents 48453fe + bf20b66 commit 29a1236
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/osd/PG.cc
Expand Up @@ -241,8 +241,9 @@ void PGPool::update(OSDMapRef map)
interval_set<snapid_t> intersection;
intersection.intersection_of(newly_removed_snaps, cached_removed_snaps);
if (intersection == cached_removed_snaps) {
newly_removed_snaps.subtract(cached_removed_snaps);
cached_removed_snaps.union_of(newly_removed_snaps);
cached_removed_snaps.swap(newly_removed_snaps);
newly_removed_snaps = cached_removed_snaps;
newly_removed_snaps.subtract(intersection);
} else {
lgeneric_subdout(cct, osd, 0) << __func__
<< " cached_removed_snaps shrank from " << cached_removed_snaps
Expand Down

0 comments on commit 29a1236

Please sign in to comment.