Project

Profile

Help

Issue #7495

closed

duplicate key violation, Repository.next_version already exists

Added by awcrosby over 3 years ago. Updated over 3 years ago.

Status:
CLOSED - WORKSFORME
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:
Quarter:
Q4-2020

Description

We have run into the situation where the my_repo.next_version integer already exists as one of the RepositoryVersion.numbers for my_repo. This causes a duplicate key violation when trying to to call my_repo.new_version()

This has happened twice when using move_content() on a CollectionVersion https://github.com/ansible/galaxy_ng/blob/master/galaxy_ng/app/api/v3/viewsets/collection.py#L268 which uses these tasks https://github.com/ansible/galaxy_ng/blob/master/galaxy_ng/app/tasks/promotion.py, but we don’t have recreation steps at the moment.

I would think this situation would not be possible due to https://github.com/pulp/pulpcore/blob/master/pulpcore/app/models/repository.py#L809, but maybe there is a bug in pulp or non-ideal use of locks in galaxy_ng.

Actions #1

Updated by fao89 over 3 years ago

  • Triaged changed from No to Yes
  • Quarter set to Q4-2020
Actions #2

Updated by bmbouter over 3 years ago

  • Status changed from NEW to CLOSED - WORKSFORME

We looked into this on the pulp side, and we believe it's not possible due to the serialization provided by the tasking system. We haven't been able to reproduce it.

I think we'll need a reproducer to be able to move forward with a fix on the pulp side. I'm closing for now since we don't have a reproduer, but I'd like to collaborate once we have any info on how to reproduce.

Actions #3

Updated by awcrosby over 3 years ago

I have not seen this since it was reported. If it occurs again I will try to see how it is reproducible.

Also available in: Atom PDF