Bug 2142689 - Capsule sync fails when a CV is published and promoted to two capsule's LCEs at the same time
Summary: Capsule sync fails when a CV is published and promoted to two capsule's LCEs ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Capsule - Content
Version: 6.12.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-11-14 21:47 UTC by Vladimír Sedmík
Modified: 2023-07-27 09:56 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-07-27 09:56:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SAT-19081 0 None None None 2023-07-20 15:37:33 UTC

Description Vladimír Sedmík 2022-11-14 21:47:51 UTC
Description of problem:
Assume we have a Capsule which is assigned with Library and one another LCE. When we create a new CV with some repo and publish and promote it to the LCE, two sync tasks are triggered for each environment, but one of them fails due to duplicity error.
This might be a corner case worthless of any attention, but since we allow users to publish and promote CVs at the same time via WebUI, it seems to be not so difficult to hit.


Version-Release number of selected component (if applicable):
6.12.0
6.11.4


How reproducible:
always


Steps to Reproduce:
1) have a fresh SAT and CAPS (on_demand, no LCE added yet), create an organization, upload manifest
2) enable some mid-size repo (i.e. rhel-7-server-kickstart) and sync it
3) create new LCE, add it to the capsule together with the Library
4) create new CV, add the repo from 2), publish and promote it to the LCE from 3) -> two capsule sync tasks are triggered, one for Library and one for the new LCE. The first task succeeds, the second one fails. 


Actual results:
Task fails with error:
duplicate key value violates unique constraint "core_repositoryversion_repository_id_number_3c54ce50_uniq"
DETAIL:  Key (repository_id, number)=(fc310174-5f54-4ccc-8495-15f4b1de55a1, 1) already exists.
Could not lookup a publication_href for repo 4


Expected results:
Both tasks should succeed.


Note You need to log in before you can comment on or make changes to this bug.