Actions
Issue #4604
closedRemove duplicates does not work properly if there are multiple repeated content types in the repo
Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 51
Quarter:
Description
It got manifested in docker plugin.
Snippet code:
async def run(self):
"""
The coroutine for this stage.
Returns:
The coroutine for this stage.
"""
async for batch in self.batches():
rm_q = Q()
for d_content in batch:
if isinstance(d_content.content, self.model):
unit_q_dict = {
field: getattr(d_content.content, field) for field in self.field_names
}
# Don't remove *this* object if it is already in the repository version.
not_this = ~Q(pk=d_content.content.pk)
dupe = Q(**unit_q_dict)
rm_q |= Q(dupe & not_this)
queryset_to_unassociate = self.model.objects.filter(rm_q)
self.new_version.remove_content(queryset_to_unassociate)
for d_content in batch:
await self.put(d_content)
When we process declarative_content.content in the batch that is different from the model we are supposed to remove the dupes, we end up to have rm_q empty which leads to removal of whole content of the model.
Files
Updated by ipanova@redhat.com over 5 years ago
Updated by CodeHeeler over 5 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 51
Updated by ipanova@redhat.com over 5 years ago
- Status changed from NEW to POST
- Assignee set to ipanova@redhat.com
Updated by ipanova@redhat.com over 5 years ago
- Subject changed from Remove duplicates does not work properly if there is multiple content types in the repo to Remove duplicates does not work properly if there are multiple repeated content types in the repo
Updated by bmbouter over 5 years ago
@ipanova I love the screenshot! It shows the problem exactly. I'm looking at this PR now.
Updated by ipanova@redhat.com over 5 years ago
- Status changed from POST to MODIFIED
Applied in changeset commit:pulpcore-plugin|01b5dd2a38c4f55fc710fb86b8fde8c92d4175bf.
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions