Skip to content

Commit

Permalink
Works around a sync-time performance regression on PG12
Browse files Browse the repository at this point in the history
closes pulp#4591
  • Loading branch information
dralley authored and dkliban committed Oct 25, 2023
1 parent 3c7c7ce commit 4c4d6aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/4591.bugfix
@@ -0,0 +1 @@
Resolved a sync-time performance regression.
4 changes: 3 additions & 1 deletion pulpcore/app/models/repository.py
Expand Up @@ -850,7 +850,9 @@ def add_content(self, content):
raise ResourceImmutableError(self)

repo_content = []
to_add = set(content.exclude(pk__in=self.content).values_list("pk", flat=True))
to_add = set(content.values_list("pk", flat=True)) - set(
self.content.values_list("pk", flat=True)
)

# Normalize representation if content has already been removed in this version and
# is re-added: Undo removal by setting version_removed to None.
Expand Down

0 comments on commit 4c4d6aa

Please sign in to comment.