diff --git a/CHANGES/4591.bugfix b/CHANGES/4591.bugfix new file mode 100644 index 0000000000..922a961d3e --- /dev/null +++ b/CHANGES/4591.bugfix @@ -0,0 +1 @@ +Resolved a sync-time performance regression. diff --git a/pulpcore/app/models/repository.py b/pulpcore/app/models/repository.py index a73bfaac93..1fe98517fd 100644 --- a/pulpcore/app/models/repository.py +++ b/pulpcore/app/models/repository.py @@ -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.