Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #4609/4c4d6aa0 backport][3.28] Works around a sync-time performance regression on PG12 #4615

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/4591.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Resolved a sync-time performance regression.
4 changes: 3 additions & 1 deletion pulpcore/app/models/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,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